Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Multiple Navmeshagents always travel to one side of a cube.

Discussion in 'Getting Started' started by sr3d, Oct 22, 2015.

  1. sr3d

    sr3d

    Joined:
    Oct 19, 2015
    Posts:
    78
    [SOLVED] - When baking the terrain navmesh set the agent radius to 0.1 - In the image below, the agent radius was 0.5 (default).

    NOTE: Later on I also figured out that setting the stoppingDistance to the width of the cube made them surround the target nicely. The cube had a width of 3f so I set the stoppingDistance to 3f


    Code (csharp):
    1. agent.stoppingDistance = 3f;   //width of cube


    FIXED






    original problem...........................
    Instead of the navmeshagents (spheres) surrounding their destination target (cube), they all huddle on one side.



    The cube is a navmeshobstacle with carve enabled and it's flat on the surface of the terrain. The terrain has it's navmesh baked properly. The navhmeshagents (spheres) like to huddle on one side instead of just naturally surround their destination.

    How can I get them to naturally surround their destination?

    Even if I spawn all the spheres to the left of the cube, they will still travel to the right side of the cube, strange isn't it?
     
    Last edited: Oct 22, 2015
    JoeStrout likes this.