Forum Discussion

Ben.SH's avatar
Ben.SH
Community Manager
1 month ago

🎥 Make NPCs Come Alive w/ NavMesh Waypoints

This Build-Along session with MHCP mentor GausRoth focuses on building a NavMesh waypoint system that gives your NPCs believable patrols and roaming behavior in Worlds. Learn to set up a NavMesh and define waypoint paths, then walk through the TypeScript logic that keeps movement in sync with your animation states so background characters feel alive.

By viewing this session, you’ll learn how to:

  • Generate a NavMesh and agent profile to define walkable surfaces for pathfinding
  • Script patrol behavior with configurable walk times, pauses, and optional random wandering
  • Build reusable waypoint paths so you can manage and extend NPC routes quickly
  • Wire NavMesh movement into animation parameters so your NPCs look like they’re really walking

2 Replies

  • I figured it out.  I had to change the coordinates under the mascot to match the actual coordinates.  I'm soo excited.😁, that bear is movin and grovin.

  •  

    I'm brand new on learning this.

    can you provide a link to the code?  I duplicated everything the best I could from the video and it's not working.  I did get assistance from the AI in the desktop editor but I'm still getting this error:

    Could not find a valid point on the NavMesh for waypoint index 1. Skipping to the next waypoint. 
    at MascotMovement.getNextPoint (MascotMovement.ts:58:14)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)
    at MascotMovement.getNextPoint (MascotMovement.ts:60:11)

     

    I'm not sure how to fix this because I'm not sure what the waypoints represent. 

    The ai created the waypoint gizmos(not sure what to call them), the physical items that appear in world.  I created the navigation, the navigation volume and connected everything like you show in the video and the written instructions.  I moved the waypoints to make sure they are inside the navigation volume.  

    Initially I tried using the AI generated npc then after watching your video I changed to the bear mascot.