Journal 118 — Unity 3D Zombie Shooter, Add 3D Character

Chris Nielsen
3 min readNov 6, 2021

--

Objective: To add a 3D character model and begin animation setup

In the last article, I finished the basic enemy AI setup and the shooting mechanism with blood splatter. Now I want to add a 3D character for the player and set up its animation.

We can start with a basic 3D character model of your choice. Before using, we want to change the rig from Generic Animation Type to Humanoid.

After this, we want to modify the setup of our original player and main camera and components in the Hierarchy. The Animator on the 3D character needs to be at the root of the Hierarchy, so we want to move the camera and collider and character controller to the 3D model.

After doing this we need to adjust the character controller and capsule location.

Then we can test the 3D character by re-attaching the player C# script and running the game.

Character Idle

Now we want to add a character idle animation with a pistol. We can use Adobe Mixamo to search for one and download it.

Then we can drag the animation into the project. Similar to the player 3D character model, we need to select the animation and make sure the rig is set to Humanoid Animation Type and Apply. Then, we need to select the animation and duplicate it, to make it editable.

Finally, we can drag this new animation onto our player 3D character and hit play. You should see the idle animation.

As you can see, the idle animation is not aiming directly forward. We can fix this by selecting the animation and setting the Root Transform Rotation to Original.

Gun Prop

The next update is to add a gun prop (pistol) to the camera view. We can make the gun a child of the Main Camera, and reposition both so the view looks first person through the eyes of the player. You’ll have to spend some time with your gun prop and character and position the gun and hand in the view that suits your needs.

Thank you for your time!

--

--

Chris Nielsen
Chris Nielsen

Written by Chris Nielsen

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

No responses yet