Polishing the Player’s Actions and Enemy Behavior
In Chapter 6, we added a ranged weapon shooting mechanic in an optimized way using Unity’s new object pooling API.
In this chapter, we will continue to add some much-needed polish to the player character with visual effects! We’ll also create some enemy non-player character (NPC) variants and finish up the chapter by introducing enemy behavior through a state pattern.
In this chapter, we’re going to cover the following main topics:
- Polishing with Shader Graph and Trail Renderer
- Enemy Prefabs and variants – Configuring with Scriptable Objects (SOs)
- Implementing basic enemy behavior using a finite state machine (FSM)
By the end of this chapter, you’ll be able to quickly add some visual effect polish to the game’s sprites using a custom shader and make several enemy variants configured with varying properties and simple state-based behavior.