0
\$\begingroup\$

My tanks working good except one thing, they not avoid each other in good way. they not generate the path to find new good position. My tank follow it own agent position and direction. I add NavMeshObstacle fit the tank size. After all this, still I get some bad things. tanks hit each other, tank moving above other tank, some time get stuck between two tanks which lead to strange movement(shaking). example this tank on the middle. enter image description here enter image description here

what can I do to improve tank avoiding ?

\$\endgroup\$
1
\$\begingroup\$

First Move the tanks off the terrain and rebake the nav mesh so the whole terrain bakes properly. Then hit control z and they should move back where you had them before the bake.

Couple things to check are :

Click on the Tank and in your Navigation Tab click OBJECT and check Navigation Static then check the Not Walkable Option and they should path around each other.

note: The object must be in the scene to set the 'not walkable' option so if it's a prefab drop it to the scene and set it.

Also on the nav agent there is a stopping distance setting that you can increase so a group of objects would not all try to pile up at the same point

\$\endgroup\$
  • \$\begingroup\$ Thank you for your replay. Yes, I can see little improvement but still they hit each other. the problem is when they get close act like stupid ! what you advice me to do ? \$\endgroup\$ – user43474 Sep 1 '17 at 0:52
  • \$\begingroup\$ it looks like you could reduce the avoidance a bit and increase the stopping distance on the agent. unchecking the autobreak may help reduce the stutter a bit also. \$\endgroup\$ – Justin Markwell Sep 1 '17 at 4:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.