Simple Patrol NPC AI (Unity)
A downloadable asset-pack
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 |
| Status | Released |
| Category | Other |
| Author | Jess Makes Things |
| Tags | 3D, Asset Pack, Unity |
Purchase
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:


Leave a comment
Log in with itch.io to leave a comment.