edited for updates: How can I convert a 360 degree rotation to a 0 to 90 degree angle so that my drone appears to tilt sideways by reading its own Z base rotation value
guys please help me:
i have this ai drone that tilts forward when moving towards player and reverses back to normal when stopping - great
What I’m doing now:
I also want him to tilt sideways based on which direction he is turning, so I took the Z axis and plugged it into the Y axis so that as it turns it tilts the drone either positively or negatively, i even setup a FInterp so that it goes back to 0 (although this is my first time using one) and I also clamped the value from -50 to 50 so that it won’t turn upside down…
The problem:
When the Z axis goes from a negative to a positive value it doesn’t interpolate slowly between either value it just jumps… for example it could be going slowly following my (player character’s movement) from 40 degress down to 0 but if it is at 40 and then i make the drone turn so that it goes to a negative 40 degrees it just jumps ( it doesn’t interpolate smoothly)…
I’m going to explain it once more in another way:The z is at 40 degrees , interp to 0 is smooth, but interp from 40 to -40 just “switches” between the positive and negative value (instead of going smoothly from 40 to 0 to -40 it goes 40 boom -40 in less than an event tick)
check out my graph and video please, thanks in advance!
For physics control, you don’t want to read the X / Y / Z rotator values – Euler angles are not physical quantities.
Instead, you want to get the basis vectors of the object (local X, Y, and Z vectors) and dot them with the appropriate vectors of the world coordinate space (typically, up,) to determine the amount of tilt, and which direction the object is tilted.
dot(object_right, world_up) means sideways tilt – positive tilted left, negative tilted right
dot(object_forward, world_up) means front/back tilt – positive means tilted back, negative tilted forward
yes i thought of that as a possible solution,but have not figured how to do that… i tried getting base turn rate but have not figured out how to convert that so it becomes degrees of tilt…