Adding an enemy character
Just as we dragged the player into the scene, drag theDude character from Assets
into the Hierarchy
. Rename this character to Enemy
in the Hierarchy
. This dude will also be red, which we don't want, so we'll create a new material.
Right-click on the Material
folder and then select Create
| Material
. Name the material enemy as Material
. Change the color next to Albedo
color control from the default to blue.
Now drag and drop the material to the enemy character. Also place and rotate the character so that it is standing opposite to the player character, as shown in the following screenshot:
Also drag the dudeAC Animation Controller to the Controller
component in the Animator
component for the enemy as well: