"Error in NPC Behavior Script on NPC Setup" on NPC spawners with Verse's auto-generated NPC behavior script when stopping/playing a map.

Yeah, GetAgent[] in npc_behavior seems broken after the last update. There’s a similar thread here: Verse AI Pathing broken after Round 1 in 33.30 - #8 by Flak

I found a bad workaround to get the agent by:

  1. Make an interface with a method signature of something like NagivateAgent(InAgent : agent)
  2. Inherit your interface in your custom npc_behavior
  3. Move your OnBegin logic to NavigateAgent
  4. Subscribe to your npc spawner device spawn event
  5. On spawn, get the agents behavior from the agent
  6. Cast the behavior to your interface
  7. Call NavigateAgent, passing in the agent from SpawnedEvent

Even with the agent though, NagivateTo still seems to be broken. :man_facepalming:

Edit: I just tested this morning though and navigation seems to be working again

1 Like