Learn to make cutscenes in unity3d by building a stealth Game.

Objective: Guard AI setup.

Before doing that create a script called GuardAI.

In the first step, select all three guards and add navmesh agents to them

Create a list of transform in a GuardAI script and serialized it.

Now Select all the guards and Attach the script to them

In this step, we need to create a waypoint for the first guard, to do this duplicate the first guard and position him on the first point and duplicate again and position him on the second point. And rename the waypoint to point a and point b.

The best practice when placing this way points is to use the NPC or enemy to place waypoints.

Create an empty game object reset its position, rename it as waypoints, and place the point “a” and “b” to the waypoints.

In the next step, select the first guard <inspector, then set the size of waypoints to 2, then drag and drop point a to the first array and point b to the second array.

Now go to the waypoint and remove the guard model in points a and b, we only need an empty game object.

Note: To delete those guards inside points a and b you need to unpack the prefab so you don't override the prefab to all guards.

See you in the next article.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Suleiman Abdullah

Self taught Unity Developer, who is passion about making games ,and he loves Math For Game Development