Challenges

For those of you who want to do more with this project, there are still plenty of things you can do, especially after finishing the rest of this book. Here are some ideas to get you thinking:

  • Right now, the enemy will continue following you even if you're through a tree or a wall. Use the Raycast function we talked about in Chapter 3, Side-scrolling Platformer, to check a line from the player when the enemy collides with something. If it does, then set the enemy's state to Idle.
  • If you're interested in adding in more complex AI behavior to your ghost, such as pathfinding, you can check out Unity 4.x Game AI Programming, Aung Sithu Kyaw, Clifford Peters, and Thet Naing Swe, Packt Publishing.
  • Add sound effects to the ghost character so that ...

Get Unity Game Development Blueprints 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.