How do I create a 2D object that shifts its trajectory based on the angle it's facing, while constantly going the same speed?
Hi there, I'm currently trying to make a 2D game that has movement similar to this:
Starting from the top the player is basically always going downwards, but can switch the angle that he is facing slightly left or right. I want to be able to rotate the character sprite a little to the left or right, and have his trajectory based on the angle he is facing (without ever being able to go purely left or right, or up). Right now my code looks like this:
My 2DRigbody (snailMovement) is a vertical rectangle, and the way the current code works, when I press right, the rectangle ends up rotating the wrong way, and after hitting right a certain amount of times, it speeds up to the right. I want to have a constant speed for my object, and I can't figure this out. Can anyone help me out please? Thank you.
Your answer
Follow this Question
Related Questions
Shortest Rotation Path at Constant Speed 1 Answer
Acceleration problem with infinite scrolling background 0 Answers
Problem with Vector2/Vector3.Angle? 0 Answers
how to find velocity magnitude relative to transform.right. 2D 2 Answers
Trying to add force to an object... is this done correctly? 0 Answers