Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: foxdeltagames on November 22, 2015, 12:55:08 AM

Title: Nav Mesh. Random location.
Post by: foxdeltagames on November 22, 2015, 12:55:08 AM
Hey guys, is there a way to make an action for a nav mesh agent to get a random location on nv mesh? The action can have options that lets you set a radius on how far the agent can pick the random location, and also store the random location in a vector 3 variable.

Thanks guys.
Title: Re: Nav Mesh. Random location.
Post by: terri on November 25, 2015, 08:16:17 AM
Try this one. I made it for a jam thing so its probably sloppy

Alternatively use the Navmesh Sample Position action after getting a random position to convert it into a point in the navmesh

Title: Re: Nav Mesh. Random location.
Post by: foxdeltagames on December 11, 2015, 05:55:34 PM
Try this one. I made it for a jam thing so its probably sloppy

Alternatively use the Navmesh Sample Position action after getting a random position to convert it into a point in the navmesh


So for example the player uses the NavMesh. get the vector 3 of the player store it in the source position, then allow the action to sample a new location, within the distance I set, then add that new position in the in the Position option, in the "Hit information of sample" and take that and add it to the agent destination action.