Wander behavior on "local" navmesh?

duncanbellsa

New member
Hi all,

I'm busy working on a coop shooter prototype similar to Rainbow Six Siege. So far, I've managed to get the navmesh and available/active obstacles syncing and updating correctly over the network.

Playing around with some Basic AI, I currently have a problem where I'd like to be more specific with regards to NavMesh Agents wander behaviour. Currently it seems like the wander pick a random spot anywhere on the available navmesh, however I would like it to pick a spot on the local "island" or "single mesh" navmesh. Not sure on what the correct terminology is, but I've attached an image below of how it looks:

Navmesh Islands:

1617040399567.png

I'm assuming I'd need to create a new script (which is fine), but I have no idea where to start to investigate this?

Thanks in advance!
 

Attachments

  • 1617040435076.png
    1617040435076.png
    503.1 KB · Views: 1
I think I may have found a solution - It seems unity has no way to tell the different between the islands, so the wander behaviour needs to include the calculate path function and only commit to the destination if that is there is an successful path.
 
I think I may have found a solution - It seems unity has no way to tell the different between the islands, so the wander behaviour needs to include the calculate path function and only commit to the destination if that is there is an successful path.
That's right - I think creating a new wander script is your best approach. You could duplicate the Wander script and then modify the target position that it returns based on the current room that the agent is in.
 
That's right - I think creating a new wander script is your best approach. You could duplicate the Wander script and then modify the target position that it returns based on the current room that the agent is in.
Thanks - I'll try it out :)
 
Top