- Home /
NavMeshAgent doesn't face to it's destination in close distance!
Two units are coming to each other as targets, Nav Mesh Agents are controlling them. The destination of each Agent is the other Agent's position. These pictures can easily say what I'm going to say:
As you can see, when their destination is not each other and is in the back, the forward of the agent and the way to destination are parallel. [1] (1)
When they are closer, so they can see each other, their destination is each other again and its kind of parallel with their orientation [1] (2) and as they go closer, [1] (3) it just getting worse, so when they reach to their stopping distance, they are not facing in a same orientation. [1] (4)
I could use transform.LookAt(Target) but i didn't, because my code would be mess in the way I've programmed. Everything should be OK with agents alone, i mean agents should look at the right orientation for real, are you kidding me? What i saw was those Arrows that depict the face of agents, were denying each other. I mean they were cool when their arrows didn't collide but when they were going to, they denied each other so looking to the wrong way.
Well, both units have agents, so they are going to avoid each other, that's the correct thing to do, because if the destination wasn't them, they would ignore and pass away each other eventually! But now they are each other's destination and they should avoid each other according to unity documents, so what should i do!? i can't use avoidance priority, because it just can't fix it if you think about that a second!
Answer by prabakar-sjn · Mar 06, 2017 at 02:19 PM
hi when two player collide just stop the agent. the continue the your script.@AliZandian