Hi!
We are trying to make a simple movement for ground units and for flying units. The issue is that the units are pushing each other when they are near, even they are moving on different nav meshes.
Two NavMeshes: Ground plane at y = 0 and aerial plane at y = 1.
Two Nav Agents: Each one with a different area mask.
There isn’t any overlapping at NavAgent height (0.3) configuration
We have tried with different navAgent height and it seems it has nothing to do with this kind of avoidance. In fact, agents with reduced radius are not pushing, which shouldn’t affect.
Also, we have disabled generating off mesh links, set the slope and the step height to 0.
Attempt 1: Height 0.3 and radius 0.5
hp9ti
Attempt 2: Height 0.1 and radius 0.5
4faie
Attempt 3: Height 0.3 and radius 0.2
npd5c
Our temporal solution is to place the air navmesh higher (y = 2) and place the mesh on a child, so we have the same flying visual effect that we need, but we are not sure if this can cause problems in future. Has anybody come across this issue and find a solution? Are we missing something or is this a Unity’s bug?
Thanks for your help!
EDIT:
We have tried modifying the base offset too and it doesn’t work.
Also, we can’t modify the avoidance quality to None as we want agents on the same navmesh to avoid each other, but not avoiding the agents on the other one.
We played with different priorities as well and the result was that only one agent could push the other one, so that won’t work either.
Not really sure what is going on but you might want to try changing:
-Base offset
-Obstacle avoidance Quality set to “None”
-Priority based on your navmesh height.
Hi, thanks for your response!
We have tried modifying the base offset too and it doesn’t work.
Also, we don’t want to modify the avoidance quality to none as we want agents on the same navmesh to avoid each other, but not avoiding the agents on the other one.
We played with different priorities as well and the result was that only one agent could push the other one, so that won’t work neither.
Crowd handling is a separate thing from navigation internally. They create a crowd and agents are moved using the crowd algorithm constrained to the path. So my guess is Unity just uses a single crowd, not one per surface. Which makes sense. You can setup surfaces for all types of situations, a single crowd is the only logical choice unless they expanded the system to let you specify other configurations. And I wouldn’t hold my breath on that happening any time soon.
Hm, I don’t know if I can be helpful, why are you guys using a navmesh for flying units? I thought navmesh is supposed to bake the details of which places agents can be or not. If your unit is flying it can go anywhere it wants, right? The actual baked navmesh would only be a big quad within the level boundaries. And if thats not the case and maybe big trees or towers would cut into the “flying navmesh”, why not just bake it on the ground in the first place? You can bake different areas, some where only air units can travel and others where both types of units are allowed. Then all of your units can travel on this one navmesh, you just have to lift the flying ones up in the air and make sure they dont collide with the ones on the ground… Anyway, Merry Christmas