Game Development Reference
In-Depth Information
NPC before, or create a new NPC. If you create a new NPC, do not forget to add the
NavMesh agent so that it can navigate.
Add two components to the NPC:
Reactor
and
Patrol
. In the
Reactor
component,
you will need to set the
Reactable
value to the
Patrol AI
asset that we created earli-
er. Then, in the patrol script, add some waypoints. Like we did for the Quick Path
patrol script, we need to set the
Vector
locations for each of the waypoints.
Tip
A tip to get exact numbers is to just move the NPC to the waypoint positions you
want and then copy the position of the NPC to one of the waypoints.
Now your game should have a character who patrols from point to point.