Hello everyone
Is it possible to avoid objects sliding down on the slope platform?
Here is my project:
https://playcanvas.com/editor/scene/1590955
I using Rigidbody
I has been set up applyImpulse to zero when player not move, but not work
Player.prototype.update = function(dt) {
if(this.app.keyboard.isPressed(pc.KEY_A)){
this.entity.rigidbody.applyImpulse(-this.speed, 0, 0);
}
if(this.app.keyboard.isPressed(pc.KEY_D)){
this.entity.rigidbody.applyImpulse(this.speed, 0, 0);
}
if(this.app.keyboard.wasReleased(pc.KEY_A) || this.app.keyboard.wasReleased(pc.KEY_D)){
this.entity.rigidbody.applyImpulse(0, 0, 0);
}
};
Keyboard A to move left
Keyboard D to move right
Thank you very much