- Home /
Can NavMeshAgent navigate tight mazes?
Hello.
I'm using NavMeshAgent to make objects navigate through a maze. I'm having an issue with speed, however. Whenever I increase the speed of the NavMeshAgents I'm finding that rather than slow down to take the corners they just bump and bounce off the walls.
I have searched the forums for an answer and haven't found one. I've tried adjusting the Speed, Angular Speed, Acceleration and Stopping Distance in every permutation I can think of trying to stop the objects from bouncing but to no avail.
Is this a known issue or am I missing something?
Thank you!!
Answer by brunopava · Apr 29, 2015 at 02:19 PM
That is dictated by its radius. If he can fit in the maze it will navigate. Also you need to bake the mesh with the correct radius.
Thank you for that.
At high speeds the Agent slams in to the walls, however. Is there any way to make it decelerate as it approaches the corners so its path is smooth? Having it slam in to walls looks a little ugly.
I did some research about this and came up with a few ideas.
1: You could mix waypoints with the Nav$$anonymous$$esh, so he must reach a corner waypoint before turning.
2: You could use Corners like this:
3: It's possible to use Nav$$anonymous$$esh.Raycast to figure out if he is about to collide with something. Thats a bit more complicated, but I guess the result is more accurate. http://docs.unity3d.com/ScriptReference/Nav$$anonymous$$esh.Raycast.html
PS: Have your tried tweeking the agent parameters? I remember once I had some issues with an agent and the config I used was this:
Speed 7 Acceleration 10 Angular Speed 999
Unfortunately my skill isn't high enough to use raycasting and tweaking the agent parameters didn't work.
The game I'm making is 2D so i have decided to use PolyNav as that system uses the same raycasting that i'm not skilled enough to use to slow down the agents as they approach a tight bend.
Thank you for your help, though!!
Your answer
Follow this Question
Related Questions
Navmesh Teleporting (With Server) 1 Answer
How to sample a point on a navMesh Agent path 0 Answers
NavMeshAgent not calculating shortest route. 3 Answers
Make Navmesh Agents more consistent 0 Answers
Enemy follow Camera 0 Answers