Game Development Reference
In-Depth Information
Adding the first enemy
We need to create a prefab for our first enemy. Doing so is simple. First, let's start with the
goblin character in the asset pack (
Fantasy_Pack\01_Characters\05.png
), split
its sprite up using
Sprite Editor
, drag sprite image
05_03
on to the scene, and then re-
name the new game object to
Goblin
. The enemy would look as the following diagram:
With the character in place, it's time to give the nasty little fellow some logic; we won't
use this just yet in this chapter but it's good to have it from the beginning (see
Chapter 10
,
The Battle Begins
, for the applied AI).
So create a new AnimatorController called
GoblinAI.controller
and place it in
Assets\Animation\Controllers
, which gives us the basic Animator view, as
shown in the following screenshot: