Jump to content

Rotate player according to the ground slope


paulo
 Share

Recommended Posts

Hi,

I'm creating a game that player can walk over terrains with lots of slopes.

How can I make my player rotate accordingly to the angle of the slope?

 

This is how it's currently working:

bUfl0mkDRD6q1LHeE1_ZKA.png 

 

And this is how is must work (I've changed the angle manually):

ZUqwkKT-RxqvXYVIum4PEA.png

 

I'm using Box2D plugin to generate the terrain accordingly to an image. That's the reason of all these bodies.

 

Thanks!!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...