Zombies and text input

In addition to the FSM for zombie behaviors, such as Idle, Chase, Attack, and Death, zombies respond to player input. Specifically, the player may attack by typing letters on the keyboard, matching the complete word above the zombie's head:

Attacking zombie with typed text input

To achieve this, we must firstly display a word above the zombie's head, then keep track of the word being typed, and finally determine whether a match has been made. We already have some code to achieve much of this, but we should now link it specifically to the zombie character. Let's start by creating a text object that hovers above the zombie's ...

Get Mastering Unity 2017 Game Development with C# - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.