Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Nav Mesh Agent - Different outcomes

Discussion in 'Navigation' started by eia, Feb 4, 2016.

  1. eia

    eia

    Joined:
    Jul 14, 2014
    Posts:
    5
    You have 2 NavMeshAgents (cars) going through a fixed set of waypoints. Acceleration and speed parameters are fixed and not changed through any external script. If the project is executed 3 different times, you get 3 different outcomes.

    Outcome 1: When you play the unity project, car 1 might overtake car 2.
    Outcome 2: When you play it a second time, car 2 might overtake car 1.
    Outcome 3: When you play it a third time, car 2 and car 1 might be in the same line.

    Is there any way to fix it to a single outcome instead of randomly getting any of the 3 outcomes above?
     
    Last edited: Feb 4, 2016
  2. TEBZ_22

    TEBZ_22

    Joined:
    Jan 28, 2014
    Posts:
    37
    To get 100% repeatability when it comes to physics is nearly impossible. One reason are that calculations are not done with a fixed interval and difference in rounding off errors accumulate.
     
  3. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Give one car an edge?
    What your describing is part of the awesomeness of the system, it gives it a reality, otherwise, you could just animate the cars to go exactly where you want them to go, and that would definitely have the consistent repeatability your looking for, another thing to consider, maybe give one car the edge in speed and acceleration, and see if thats enough. (may totally not be that consistent, but worth a try if your trying to stick to the waypoint method)
     
    pixxelbob likes this.