- Home /
Question by
Injec · May 23, 2017 at 12:53 PM ·
c#navmeshnavmeshagentnavigationnav mesh
NavMeshPath.corners.length is always 0
Hey. I want to use the CalculatePath() function to calculate a Path, so i dont need to use a NavMeshAgent, and I am able to walk the Path manually.
So the problem is, the resulting path has always a Length of 0.
Here is the important part of the Code I use:
NavMesh.CalculatePath(character.obj.transform.position, hit.point, 100, path);
Debug.Log(path.corners.Length);
Both variables character.obj.transform.position and hit.point are valid. I also baked the NavMesh. What could the problem be?
Comment
Answer by Injec · May 23, 2017 at 01:30 PM
So i fixed it, for everybody following this question:
NavMesh.CalculatePath(character.obj.transform.position, hit.point, NavMesh.AllAreas, path);
Debug.Log(path.corners.Length);
Thanks to Seriphis from the GameDevLeague Discord!