Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

AI Planner - Problem when using world state after Navigate Action

Discussion in 'AI & Navigation Previews' started by Rarotunga, Apr 15, 2021.

  1. Rarotunga


    Jul 12, 2015
    In my decision controller, I set the callback to the navigate action to a function that instructs a navmesh agent to go towards the target location, then waits until its remaining distance is zero, and even sets my position to equal the target position for good measure, avoid possible rounding errors

    This works fine if the decision controllers uses the next plan step, but if I set it to use world state then after it reaches the destination it enters an infinite loop where it keeps trying to navigate to the place it is already in, because it deems that the two positions are not exactly the same.

    Is there any way to change the preconditions of one position being equal to another so that they only need to be *nearly* equal to one another? Or such that we can ignore the Y component of the positions?
    I want to be able to use world state so that the agent is aware of changes that occurred while it was moving after reaching the destination, and it is being an annoying limitation.
  2. vx4


    Dec 11, 2012