You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you trying to make the player sprite rotate to match the ground, a la Sonic? That's pretty simple:
Put the sprite in its own game object.
Have some component that has a reference to the sprite object's Transform. This can be the Player script, or it could be some other script. For the sake of organization and reuse, I'd create a new component to do this, but that's just one option.
In this component's Update method, have it get the angle of the slope (from collisions.slopeNormal) and write that value over the sprite Transform's eulerAngles.z.
Some extra work will probably be needed to get the sprite to stop floating above slopes with higher angles.
The text was updated successfully, but these errors were encountered: