playMaker

Author Topic: how to use a navmesh that can avoid moving objects?[SOLVED]  (Read 10361 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
how to use a navmesh that can avoid moving objects?[SOLVED]
« on: November 06, 2013, 10:40:17 AM »
Hi,
If I have 2 NPC agents that are using a navmesh, how can I set one that avoids the other? Are there any actions that can be used to move around an object that isn't static i.e a NPC ?
« Last Edit: November 08, 2013, 12:52:23 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to use a navmesh that can avoid moving objects?
« Reply #1 on: November 07, 2013, 12:17:38 AM »
Hi,

 NavMesh agents can avoid each others, there is a setting for this:

http://docs.unity3d.com/Documentation/ScriptReference/NavMeshAgent-avoidancePriority.html


But agents can not avoid moving objects, you can, but you need to write a behavior for this to check what's in front and avoid it while keeping the destination as target. It's definitly not trivial.

 Have you looked at other pathfinding on the asset store, maybe ( likely) some propose dynanmic object avoidance.

Bye,

 Jean

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: how to use a navmesh that can avoid moving objects?
« Reply #2 on: November 07, 2013, 11:23:30 AM »
Hi,

 NavMesh agents can avoid each others, there is a setting for this:

http://docs.unity3d.com/Documentation/ScriptReference/NavMeshAgent-avoidancePriority.html


But agents can not avoid moving objects, you can, but you need to write a behavior for this to check what's in front and avoid it while keeping the destination as target. It's definitly not trivial.

 Have you looked at other pathfinding on the asset store, maybe ( likely) some propose dynanmic object avoidance.

Bye,

 Jean
Excellent thanks Jean.

Phuzz

  • Full Member
  • ***
  • Posts: 101
    • Bzilla Games
Re: how to use a navmesh that can avoid moving objects?[SOLVED]
« Reply #3 on: August 31, 2015, 12:09:00 PM »
Hello,

I know this Topic is old but just wanted to share my workaround for this that I found on Unity forums, just set a Random priority from 1-100 on start,  I did this and now Navmesh agents dont face each other stuck forever.
Bzilla Games "Education with a Tickle!"
Qbucket Games "Voxel Games"