Helping with a crouch script

Is it possible if any of you mods have a crouch script or a link that will help?

1 Like

Hi @Gabriel_Dobrzynski,

I don’t have a script in mind, but things that you could to make it happen

  • When the crouch key is pressed you could change the height of the player collider to a smaller one. That will lower the center of mass of your player controller at the same.

Though it’s not recommended to change the collider on runtime (the collision shape has to be recreated), so another alternative is to have two collider entities, one for the standing pose and another for the crouching one. So you enable/disable each one respectively.

1 Like

oh so basically, short term and easy to know um create another player smaller then script it so when you press crouch key you get smaller and have the weapon in ur hand and shoot

1 Like

Well, I wouldn’t create two player controllers, that would create a different set of problems.

But yes, depending on your use case, experiment with that.

1 Like

thanks very much i will try that when my friend comes online we can test cause i have school now

2 Likes

well, what dani did is he made the collision and model change when the key is pressed, and set it to default when released, i may be able to help with that code.

2 Likes