- Home /
Move a 2D character on an uneven ground and also keep moving it in same direction irrespective of the change in rotation
I am working on a project where the object is to moving on uneven ground. It is also performing some flips in the air as you can. I am currently using wheel joint to move the object because I couldn't find any other way to achieve this. This is also the reason why I had to change my character to a vehicle. What I want is that my character moves just like the character in Alto Adventure. I tried using transform.translate and different rigid body components etc. but it wasn't helpful at all.
Are you using motorSpeed on the WheelJoint2D or are you applying force to the Rigidbody to move it?
I am using WheelJoint 2D then enabling Use$$anonymous$$otor
When you're in the air doing flips, you can apply the force Vector3.right (or -Vector3.right) which will give you world right and left, independent of the player direction.
When you're on uneven ground, using the motor should still move the player along the ground no matter how uneven it is. Is it slipping? $$anonymous$$aybe you need to increase the friction so it grips hills better.
Your answer
Follow this Question
Related Questions
2d Movement Messes up when cube is rotatated 0 Answers
Basic 2D movement C# - Key presses cancel eachother out 4 Answers
Sprite will not roate when arrow keys are pressed 2 Answers
Rotating an object towards target on a single axis 2 Answers
How should I move a sprite in a direction based on the rotation of a child? 1 Answer