Is it possible to avoid objects sliding down on slope platform?

Hello everyone
Is it possible to avoid objects sliding down on the slope platform?
Here is my project:

I using Rigidbody
I has been set up applyImpulse to zero when player not move, but not work

Player.prototype.update = function(dt) {
      this.entity.rigidbody.applyImpulse(-this.speed, 0, 0);  
      this.entity.rigidbody.applyImpulse(this.speed, 0, 0);  
    if( ||{
       this.entity.rigidbody.applyImpulse(0, 0, 0);  

Keyboard A to move left
Keyboard D to move right

Thank you very much

Hi @supsersuperman,

That happens because friction on your main player is set to 0, so even though friction on the platform is set to 1, the player will slide down.

You can set it to 1 on the player rigid body component, though you will need then to update your movement logic to calculate the forward vector based on the direction of the platform. Otherwise the player will be unable to climb up that slope.

1 Like