Game Development Reference
In-Depth Information
In the previous screenshot, we can see a simple example of this: there are no animations
connected to any of the states. We are just using them to track and control what drives our
state machine. Using the parameters, it's easy to configure the following settings:
• If the player is seen, the enemy attacks
• If the player is seen and is attacking, the enemy should defend
• If the player attacks when the enemy is attacking, the enemy should defend
• If the player stops attacking, then the enemy should attack back
• If at any time the enemy health is less than 2 and the player's health is greater than
2, the enemy should run away
• If at any time the enemy loses sight of the player, then go back to idle
So by controlling the input, we know how the enemy will behave, and this is completely
configurable within the controller without any complex scripting.
Search WWH ::




Custom Search