- Home /
Question by
Nightkilla · Dec 23, 2014 at 11:13 AM ·
2drotationphysicsrigidbody2dvelocity
2D Geometry dash-like ship physics
What I need to do is have my player rotate on it's Z axis according to it's velocity, like this. Unlike the video, my player's X position never changes. Here is my code (JS):
function LateUpdate (){
player.transform.rotation.z = player.rigidbody2D.velocity.y;
}
When I touch the ground, my player twitches uncontrollably, and when I am off the ground (at any point) my player is flipped upside down.
Comment
Your answer
Follow this Question
Related Questions
Unity C# 2D Adding Velocity on rotation 1 Answer
Movement Relative to Rotated Parent 1 Answer
Projetil rotation in straight line trajectory 2 Answers
How to Smooth Out Constant Velocity on Rigidbody2D 1 Answer
Rotating gameobject to velocity 1 Answer