I'amI'm making a 2d platform videogame2D platformer game with the default Unity 2D physics of unity2D , and. I am implementing slopes but, but my player slips down the slope because of the physics. I will send a picture.
My code of the player movement:
MoveInput = Input.GetAxisRaw("Horizontal"); rbd2.velocity = new Vector2(MoveInput * speed, rbd2.velocity.y); //rotacion de personaje if (MoveInput > 0) { transform.localScale = new Vector3(1f, transform.localScale.y, transform.localScale.z);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 personaje
if (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);
}
