Bringing the NPC to life
Our NPC will be present in all the scenes; otherwise, we will not be able to leave the world. To facilitate this task, we will create a Prefab that houses the character and its functionalities.
To achieve this, we will follow these steps:
- Anywhere in MainScene, drag and drop the Peasant Girl@Dwarf Idle asset. If we click Play, we will see that the character is static; it has no life and it doesn’t move with the animation we selected in Mixamo. This is because we need to add an Animator component and link the animation.
Figure 7.8 – Placing the FBX model in the scene
- While in the Peasant Girl@Dwarf Idle GameObject, click on the Add Component button in the Inspector panel and add the Animator component.
Figure 7.9 – Animator component
- The Animator component needs an Animator Controller. To create an Animator Controller, in the Assets | _App | Characters...