- Home /
How do I make my sprite change it's rotation based on the slope it's is on?
So I want by sprite to fall all the way down. If you don't know what I mean you can see what I mean in the picture below. When my character is on a slope I want his rotation to change based on the slope. Again, if you don't know what I am talking look at the image attached. Please help me fix this problem and explain step by step on how I can fix it.
Answer by xxmassassenxx · Apr 14, 2020 at 07:41 PM
If you use rigidbody and dont freaze the z position it will tilt but if you just walk of a ledge it will probably face plant. it that matters i have no clue how to fix it
Answer by cubeactive · May 09, 2020 at 04:59 PM
Maybe just check to see if the character is on a slope and manually adjust the rotation of the sprite. I Think you can use the raycast function to see what kind of ground it is on. I'm assuming your slopes are always the same angle.
Your answer
Follow this Question
Related Questions
2D Physics Rotate Sprite Level With Floor 1 Answer
How can I dynamically change colliders when animating a 2d sprite? 0 Answers
How do i place borders and sprites on camera edges? 0 Answers
How do I connect a spring joint 2d to a rigidbody in script? 0 Answers
Physics2D simulation is not taking into acount the material's Friction 1 Answer