Implementing the NPC
With the foundation complete, we can now add the character that will eventually patrol the area and chase the player. As previously mentioned, we have picked an asset that will strike terror into the heart of the player as they are stalked mercilessly by the Toon Chick
:
- Locate the
Toon Chick
prefab in theAssets/Meshtint Free Chick Mega Toon Series/Prefabs
folder in the Project panel. This folder was added when we imported the Toon Chick package:We'll refine this prefab by adding our own pathfinding logic.
- Drag and drop the prefab to the Scene view:
- Select the
Toon Chick
from the Hierarchy. - As the chick will be moving around the environment, we'll add a Rigidbody. In the Inspector, select Add Component | Physics | Rigidbody.
- On the Rigidbody component, under the Constraints heading, Freeze Rotation on the X and Z axes. Freezing...