Hertzole / gold-player

A first person player controller for Unity.
MIT License
160 stars 16 forks source link

Adding run/crouch toggle options #27

Closed ghost closed 5 years ago

ghost commented 5 years ago

This should close out #18, which is a couple of features I wanted to have in the controller.

Crouch toggling behaves nicely in that if you toggle crouching off while the player can't stand, they'll do the automatic standing like what happens currently if you let go of crouch while underneath something. That seemed reasonable.

Run toggling I gave two options for, one that is just a normal toggle on/off and a separate toggle that automatically turns off if the player stops providing movement input. The latter is how I like my sprint toggles, but it is easy enough to have both in there for people to choose from.

I also made both enums for future extensibility, even though crouching only has two modes, that way additional toggle modes could be implemented without breaking serialized versions of the components.

Hertzole commented 5 years ago

These are some amazing changes! Looking through them it all makes sense, so I'll merge them.

Thanks a ton for your contributions!