- Home /
Navmesh agent forward movement
I am still fairly new at Unity, and kind of understand the navmesh agent.
I want my characters to move in a specified direction, without a a known direction using navmesh agents.
Is their a built in feature to tell a navmesh agent to move forward? Or is their a better way to do the job?
Answer by Tiras69 · Oct 19, 2017 at 02:31 AM
Hello Nemneb. I'm not really sure of what you want but in the first place make sure to have correctly read all the documentation about the navmesh system and especially the navmesh agent.
About the agent that want to follow a line there's a lot of solutions. You can either make a script that take an initial direction for your agent ( that you would have specify ), in the script you will set a destination point near the player in the given direction once the point reached, it'll do this all over again until there's no more navmesh left. You can either set two points represented by an empty game object and set a beginning and a destination point in a custom script.
For a desired speed you must edit the values in the agent component.
For your AI you can use either a raycast or an collider with the trigger set to true in order to get the perceptions of your agent check the documentation for each of those components.
I would be please to give more details if you'r still in trouble.
Hope that it would help you.
Thank you Tiras69 for your answer,
I will also edit my question to be more precise and to the point.
In short, I basically want to use navmesh to move my characters in a specified direction, without a known destination.
I will look into your solutions to see if they help.