- Home /
interpolated rotation
im trying to "lean" the gameobject in what ever direction it moves. the gameobject moves on the x axis and i'd like it to rotate on the z axis slightly depending on the speed. like using a math.lerp but for rotation any idea what i should do thanks HolyheadIT
Answer by DaveA · Dec 14, 2012 at 11:02 PM
Slerp instead of lerp
and that'll just lean it and then return when velocity is 0?
Well you need to set the ranges of 'lean' but if it went from, say, -10 to 10, then at the .5 point it will yield zero. But it does 'rotate' the values. In fact was just using it to do pretty much that. Look for "Popup Book" in Asset Store co$$anonymous$$g soon!
great thanks im using quaternion.slerp and quaternion.euler to input data. but i want to base it off my velocity and my object is moving because of mathf.lerp and its following another object so the velocity.x and velocity.magnitude are returning 0, how can i get a speed from it without velocity? thanks again appriciate your help
Your answer
Follow this Question
Related Questions
Position and rotation of a game object acting wired 0 Answers
Simulate rotation using two force thrusters 1 Answer
How to get angular difference? 2 Answers
Control Ship and Gun Separately 2 Answers
Transform - GameObject? 1 Answer