NavMesh Baking issue

Updated on January 27, 2016 in [A] Other Answers
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on January 26, 2016

Hi everyone, I have the simplest situation ever and it’s not working..

I have a plane and a cube on it, and want to make the plane walkable. I open the navigation tab, make them both static, set the plane layer to “walkable” and the cube layer on “not walkable”, then bake. Nothing happens. Then, when I play around with stuff in a random way to try to understand the problem, I get a walkable surface! But.. it’s the side of the cube.. not even the top, just the side (and of the cube, which should not be walkable at all!). Any ideas what could possibly go wrong?

  • Liked by
Reply
2 on January 26, 2016

from what it sounds like you want the plane to be the floor and the cube to be a wall or some other obstacle, if that is the case you would need to make the cube a navmesh obstacle, try this add a capsule to the scene and give it a navmesh agent component, then add an empty and move it somewhere make a c# script name it something like findtarget and add it to the capsule, in the script add the following :

public Transform Target;
NavMeshAgent Agent;
void Start() {
 Agent = GetComponent<NavMeshAgent>();
 }
 void Update() {
 Agent.SetDestination(Target.transform.position);
}

 and see if it avoids the cube, if not add a navmesh  obstacle  component to the cube and re-bake the nav mesh, also both the plane and the cube would need to be navagation static.

Helpful
on January 26, 2016

Okay, I will try tht and see if it gets solved, thx!

Helpful
on January 26, 2016

one thing i forgot to add was set the empty as the target of the script

Show more replies
  • Liked by
Reply
Cancel
0 on January 27, 2016

So, I think the problem is the following: my game (the ground on which the player moves) is built on the x-y axis, however the navmesh seems to take as walkable surfaces only the ones on the x-z plane.. Is it possible to change that, or must I rotate my whole game onto the x-y axis? That would be a disaster for me

  • Liked by
Reply
Cancel