Quantcast
Channel: Stop 2D platformer character from sliding down slope - Game Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Stop 2D platformer character from sliding down slope

$
0
0

I'm making a 2D platformer game with the default Unity 2D physics. I am implementing slopes, but my player slips down the slope because of the physics.

Character standing on slope

Here is the code I use for the player movement:

MoveInput = Input.GetAxisRaw("Horizontal");rbd2.velocity = new Vector2(MoveInput * speed, rbd2.velocity.y);//rotacion de personajeif (MoveInput > 0){    transform.localScale = new Vector3(1f, transform.localScale.y, transform.localScale.z);            }if (MoveInput < 0){    transform.localScale = new Vector3(-1f, transform.localScale.y, transform.localScale.z);            }

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>