Creating the zombie prefab
We can now begin the process of incorporating the Zombies into our scene. The Zombie asset created by Pxltiger comes with the models, materials, textures, and animated prefabs. This saves us hours of work constructing the elements, but we still need to prepare the assets for our scene and create a means of controlling the various states needed to have the creature interact with our player:
- Create the
Zombie
prefab by dragging theZombie/Model/z@walk
asset from theProject
window to theHierarchy
window. When the item appears in theHierarchy
panel, the text will be blue.
We are utilizing the walk animation since our biters will always be moving. For future projects, you might want to use an idle or default animation as the project requires.
- Rename the
z@walk
item toZombiePrefab
in theInspector
panel. - Add a Capsule Collider component to the prefab item with the following settings:
- Center=
0
,0.85
,0.3
- Radius=
0.17
- Height=
1.7
- Center=
- Add a Rigidbody component.
Adding the Rigidbody...