Edit collision realtime

Hi! I want to make it so my players collision changes when certain keys are pressed, how can I do this?

What do you want to change exactly?

The height, I have a capsule rigidbody and I want to squish it down to 1 when shift is pressed.

@Cryptonaph Are you looking for Crouching? Maybe this post can help.
First Person Movement Crouching - Help & Support - PlayCanvas Discussion

1 Like

Well, I used that code that Leonidas posted, but the thing is I want it to slide when held, and whenever I hold down shift, it makes it so I can’t move anymore/really slow movement, and is slowly falling to the desired height. After doing this at all, the player no longer moves properly.

I might have just done something wrong, one second.

Alright so I got it to work only when held down, but I want to make it so that when the player is sliding they actually slide instead of either stopping completely or continuing to be able to move. How would I achieve this? Sliding is line 133 in first-person-movement.js.

Game: PlayCanvas 3D HTML5 Game Engine