A downloadable asset-pack

Get this asset-pack and 2 more for $7.00 USD
View bundle
Buy Now$3.00 USD or more

Simple NPC Patrol AI

-------------------

This package contains a lightweight, plug-and-play patrol AI for NPCs using Unity’s NavMesh system.

Features:

-NPC movement between assigned waypoints

-Looping patrol paths

-Adjustable stopping distance

-Smooth rotation toward movement direction

-Clean, commented C# code

-Demo scene + ready-to-use prefab

How To Use:

1. Make sure your scene has a baked NavMesh (using NavMesh Surface or Unity's built-in navigation).

2. Create waypoint objects (empty GameObjects) and position them in your scene.

3. Assign these waypoints to the waypoints list on the PatrolNPC.

4. Drag the PatrolNPC prefab into your scene.

5. Press Play. The NPC will automatically patrol between the waypoints.

Script Fields (NPCPatrol.cs):

-Waypoints: A list of Transforms the NPC will move between.

-Stopping Distance: How close the NPC gets before switching to the next waypoint.

-Loop: If enabled, the NPC restarts the patrol after reaching the final waypoint.

-Rotation Speed: How quickly the NPC rotates toward movement direction.

Included:

-NPCPatrol.cs script (SimpleNPCPatrol/Scripts)

-PatrolNPC.prefab (SimpleNPCPatrol/Prefabs)

-PatrolDemoScene.unity (SimpleNPCPatrol/Demo)

Tested in:

-Unity 2022+ with NavMesh system.

Published 11 hours ago
StatusReleased
CategoryOther
AuthorJess Makes Things
Tags3D, Asset Pack, Unity

Purchase

Get this asset-pack and 2 more for $7.00 USD
View bundle
Buy Now$3.00 USD or more

In order to download this asset-pack you must purchase it at or above the minimum price of $3 USD. You will get access to the following files:

SimpleNPCPatrol_v1.0.0..unitypackage 45 kB

Leave a comment

Log in with itch.io to leave a comment.