1. Submit bugs to enter our 5.4 Beta Sweepstakes. Read more about it here.
  2. Unity 5.4 public beta is now available for all users. Grab the build and visit the 5.4 beta forum.
  3. Missing a module? More about the new installer in 5.3 here.
  4. 4.7.1 released for Xcode 7.3 support. Thread here.

Calling NavMeshAgent.SetDestination in Update() stops stoppingDistance working?

Discussion in 'Scripting' started by yezzer, Apr 28, 2012.

  1. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Messages:
    119
    Simple example:
    Works correctly:
    - User clicks, agent.SetDestination(somePosition) is called.
    - Agent navigates to destination, and stoppingDistance is used.

    Does not work correctly:
    - on Update(), agent.SetDestination(somePosition) is called.
    - Agent navigates to destination, stoppingDistance is disregarded.

    Is this in fact the correct behaviour, or should I file a bug report? If it's the correct behaviour, I think it should be noted in the docs.

    It's sort of mentioned here, and AngryAnt responds with:

    FWIW, I'll do some variation of this. I was aware what I was doing was inefficient, but intended to deal with that later.