Support Forum

NavMeshCut, not applying rotation correctly

Hi there,

My maps are usually orientated along the 3 world axis - everything the user can build (which then has a NavMeshCut) is neatly rotated to 90 degrees along the 3 world axis.

I have one map that doesn’t follow that rule, and it gives me a bit of a headache.

My NavMeshCuts are set up like this:
image

When the player places an obstacle down on a “tilted” road, the NavMeshCuts rotates properly along the Y axis. However, it doesn’t rotate long the “tilt” of the road.

If you look at the image here, the user placed obstacle (the stack of boxes) is slanted like the road (compare it to Unity’s axis indicators in blue/red/green). You can see the green outline of the obstacles collider that is rotated the way it should be.

The NavMeshCut on the other side is not rotated this way, even though it’s a child of the stack of boxes (so to speak - the NavMeshCut gameobject has the same rotation as the stack of boxes with its colliders).

Because of that, it takes up more space than it should. You can see that by looking at the navmesh outline to the left of the stack of boxes: It should always be the same width, because there’s always a gap of 2 squares between the obstacles.

Can you please shed some light on this?

Hi

Hmm. I’m not quite sure why this is. If Use Rotation And Scale is enabled, then the cut should rotate properly.

However, it is possible that there is a bug (especially if you are using some kind of non-uniform scaling). You could try the beta version (A* Pathfinding Project), I have rewritten a lot of the navmesh cut logic, and improved it a lot. If you use the new “Box” option, instead of the old “Rectangle” option, then it should be much more intuitive how to position and rotate it at as well.

Hi Aron,

I’m on the beta, although an older version (4.3.48) and I’m using Box instead of Rectangle (see the first screenshot).

The navmeshcut does not ignore rotation. But it appears to always be a box that is aligned “upright” for lack of a batter word around the world axis. If I rotate my gameobject that has the box-shaped navmeshcut in any axis but the Y axis, it seems to rotate an internal box and then afterwards place the navmeshcut box along that internal boxes boundaries.

I’m sorry if I can’t describe it very well. I would expect the option “Use rotation and scale” to mean that there is always the same sized box cut out of the navmesh, no matter how I rotate it. But that’s not what happens.

I can’t currently upgrade to the newest version because it would mean a huge load of testing, and I’ve already found a workaround that solves this for me. But I can’t imagine that’s the intended behaviour.

Hi

Is the whole graph rotated and aligned with the floor in this region? Or is it just this part of the world that is not aligned with the graph’s up direction?