- Home /
How to build a custom shape NavMesh Area
Hi, In my game, I have NavMeshAgent NPCs that have an array of 4 available target game objects.
Because there are lots of NPCs, I want to alter their target position a bit each time by calling "GetInsideUnitCircle", multiply that result by 20 and add it to the position of the original target. Next, I am sampling the position on the Agents NavMesh Area.
The NPCs targets are inside a Big Sphere that has an "OnTriggerEnter". When the NPC walks into it, it triggers an event.
My problem is: Because of the big radius around the target, not all NPCs walk into the trigger sphere.
My Question: Is there a way to build a new NavMesh Area based on the trigger spheres size, so I can sample a position on that Area instead of the entire NavMesh?
Thanks!
Answer by W1zzel · Aug 13, 2020 at 09:55 AM
Okay, so I found a way by creating a cylinder, set its Y scale to 0, and marked it with the desired area. Then I used some other geometry to block unwanted NavMesh Areas.