Search Unity

How to Stop NavMeshAgent from Pushing Other Agents

Discussion in 'Scripting' started by Mortalanimal, Oct 23, 2019.

  1. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    566
    Hi, so I have NavMeshAgent that is attached to both Infantry and Tanks. and usually the agents dont mind nudging other Agents as they move past. but how do I stop it or reduce its effect? in the case of my Infantry pushing my tank like its a feather it just looks wrong. I tried to increase the mass and drag of my tank (Via Rigid body) but that didnt even work.

    Thanks in advance, I also changed the "Obstacle Avoidance" priority but i dont think that did anything, I would appreciate an explanation on this also. thanks


    Furthermore, is there a way to make it so the Agent collider is not a cylinder? a square would make more sense on a tank
     
    Last edited: Oct 23, 2019
  2. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    Set obstacle avoidance quality to none for both of the navmesh, the navmesh will stop pushing other navmesh.
    You cannot change the shape of navmesh.
     
    Kekaku and Mortalanimal like this.
  3. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    566
    Thank you
     
  4. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    No Problem.