How to avoid other moving gameObjects?

I have multiple gameObjects with AIPath, CharacterController and with Seeker components. I have script that will use AIPath to follow objects automatically and sometimes I use Seeker to move my gameObjects manually. There is one GameObject with AstarPath. In mask I made it to avoid objects with Obstacles layer. They are moving by avoiding these obstacles but they are ignoring each other. Sometimes they are preventing each other to move into their positions.

How I can make them consider each other when they are calculating path or change path when other moving gameObject on the paths way? (I have even added them to mask, does not work).

I have created empty GameObject in my scene added GraphUpdateScene component to it. Created 4 points by pressing shift+click and placed them so they can fit my grid graph. Ticked walkability and update physics then rescanned my graph my A* gameObject. Still nothing happens. Place where my moving gameObjects are standing now does not consider as obstacle. What I did wrong?

I have created script that will call Scan method on Update. I works exacly how I want, but it is affecting to performance of game.

Sorry for the late answer.


If you have very few obstacles you can use tags to mark the nodes below the agent using a graph update and then set the Seekers tag mask to only include the default layer and the layer corresponding to that agent.
However I would suggest using some kind of local avoidance instead. (e.g UnitySteer or the local avoidance included in the pro version).

Solving it perfectly is a very hard problem known as Cooperative Pathfinding, that requires some algorithms not included in this system (not in most pathfinding systems, none that I have seen).

I solved by adding Dynamic Grid Obstacle script as component of my gameobjects