O'Reilly logo

Game Development with Unity by Michelle Menard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Writing the Character and State Controller Scripts

To get Widget up and running, he needs both a character controller and a state controller script. The former will define exactly how he moves and behaves while parsing the input from the player to direct him. The state controller holds all his necessary vitals and information, such as his current health and energy points and which functions can directly affect these stats. The state controller could also define more broad aspects of the character, such as whether he is controllable, dead, or alive. To get started, load your last save from Chapter 7 with the newly imported Widget character. All the scripts for this chapter are included on the DVD and can be simply imported into the scene ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required