iamIcarus
iamIcarus

Reputation: 1438

NavMesh Agents NPC local avoidance

How to set the NPC with NavMeshAgents to perform local avoidance and not to pump and push each other until reaching there goal?

Upvotes: 2

Views: 3676

Answers (1)

user3973392
user3973392

Reputation:

I personally use avoidance priority in a way that it helps. For example, according to NPC's states, you can assign avoidance priority from 0 to 99 so they act a little better. For more information about avoidance priority, Take a look at here!

In my ongoing project, i set them like this: If state of NPS is just goofing around, then set it's priority to 50. and if NPS has a target, set to 40. And for whom they have targets, according to their distance to targets, set from 40 to 10. Then if NPS is fighting, set it to 5, if its controlling by the player, to 3 and so on, it was just a brief example.

There is another way, and that's having another child object for each NPS for navigating the path, and by using vector.lerp to follow it. It smooth and make the results mush more better, and this is Nikolay Dyankov's way i saw couple of days ago. You can read the full article Here!

Upvotes: 2

Related Questions