Adding Behaviors To My Player In Unity

I have been reworking a lot of the logic that runs my player. In the past I had one master class that managed everything, with maybe a controller class to abstract input. Now I am breaking out each type of behavior in its own script and making them completely independent. It looks something like this:

Ember

Now I can simply enable or disable behaviors on the fly. An example would be if the player picks up a jet pack, I can turn off the jump and let that new behavior completely change the way the player is controlled on the fly. Here is a sample of how this is working now with walk, jump, shooting and duck.

play-test-2

I still have a lot of work but I am really happy with the way this is coming together.

Subscribe To My Mailing List

Want to learn how to make a game? Not sure where to start? Even if you are a seasoned game maker there is still a lot you can learn from my mailing list. I'll be covering tips and tricks for how to build, release and market games each month.

Simply sign up for my mailing list and also get access to a 50% off discount code for my eBooks and other content. I promise to not spam your inbox!

Join Now