What is the proper way to do slides in 2D platformer game?

Hi,

I am able to measure on what slope angle my player is standing on by using ray. Now I want to ask what is the proper way to make him slide down the slope? I tried to increase gravity but my player doesn’t jump when sliding down the slope. I also tried to add velocity to my rigidbody. When i added velocity.x the player was in the air a litle bit. When I added velocity.y too much, my player sometimes fell through the ground…

I want to make him slide different slopes with different speed. How should I achieve it? Please, help me…

hey again!

so last time we found the normal, have you tried adding a force down the slope?

you can get the direction down the slope with a little maths

Vector2 normal; //the normal we already have from the raycast we did
Vector2 downSlope = new Vector2(Mathf.Sign(normal.x)*normal.y, -(Mathf.Sign(normal.x)*normal.x));
Rigidbody2D ourCharacter; //the rigidbody attached to our character
ourCharacter.AddForce(downSlope);

Alternatively you could try different materials for the ground, with less friction.