playMaker

Author Topic: Nav Mesh. Random location.  (Read 3695 times)

foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Nav Mesh. Random location.
« 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.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Nav Mesh. Random location.
« Reply #1 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


foxdeltagames

  • Junior Playmaker
  • **
  • Posts: 62
Re: Nav Mesh. Random location.
« Reply #2 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.