I procedurally generate my level, so I’m unable to accurately predict how large it is or in what direction it will go in. Right now, I’m using an obscenely large grid graph to ensure that the entire level is pathed.
To somewhat lessen the performance impact of this, I’m trying to manually adjust width/depth of the grid graph found in AstarPath.astarData.gridGraph but it doesn’t seem to take effect. Is there somewhere else I’m supposed to be doing this? Is a grid graph even suitable for this?
This is only called after the dungeon is generated. To test this to make sure it’s being called after the generation, I tried manually setting the width/depth like normal and then use this:
Ah, it was the height of the center of the graph. Didn’t notice it. Got it working now.
Quick last question: It seems grid graphs ignore mesh colliders. Is there a way around this? While I wouldn’t use many, if any at all mesh colliders in the final build, when prototyping it’s much quicker to generate a quick mesh collider rather than parenting a bunch of box colliders to match the shape of the room.
Does it ignore mesh colliders??
That’s really odd. The system just uses the UnityEngine.Physics API to check for collisions, and that should work for all types of colliders.
Are you sure they are not in a layer that is excluded from collision/height testing?