Use the following steps to create an enemy:
- Create a new primitive using Create | 3D Object | Capsule in the Hierarchy panel and name it Enemy.
- Inside the Materials folder, use Create | Material, name it Enemy_Mat, and set its Albedo property to a bright red:
- Drag and drop Enemy_Mat into the Enemy GameObject.
- With Enemy selected, click on Add Component and search for Sphere Collider. Then, hit Enter to add it:
- Check the isTrigger property box and change the Radius to 8:
Our new Enemy is now surrounded by an 8-unit trigger radius shaped like a sphere. Any time another object enters, stays inside, or exits that area, Unity will send out notifications that we can capture, just like we did with collisions. Your next challenge will be to capture that notification and act on it in code.