I'm trying to set MoveAIComponent.Blocked = true programmatically, but the AI still continues to wander when it's not supposed to. Despite Blocked being True and CanUse being False, the AI still walks around. I'm resorting to clearing the NavMesh destination and disabling the NavMeshAgent component, but this seems like a bug?

image
  • If you set Blocked to true the move AI will stop and no longer update - so I'm pretty sure this is not something being done by the move AI. What mode is the move AI in (check the component's inspector)?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • It seems like the issue is that the AI isn't stopping immediately after conversantMoveAI.Stop() and conversantMoveAI.Blocked = true, so it completes its current route before stopping, or maybe it just takes a second to stop - but I want it to stop immediately.
  • Remove the call to Stop and only set Blocked = true. This will also stop the move AI - first stopping before blocking might trigger some idle behaviour and next waypoint mode stuff (though the block afterwards should still stop that).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.