Grid Graph and Stairs / Inclines

Hello,

I’m trying to make a turn-based game using the grid graph or layered grid graph. Since we are unable to create multiple grid graphs and then stitch them together, how do I use the graphs on inclines and stairs? I’ve attached an image to clarify. The scan recognizes that the stairs are there, but places horizontal grid squares there. Is there a way to rotate them?

Also, do I have to update to 2019.3 to use the 8-directional movement with the layered grid graph? I’m using SteamVR for this game, and 2019.3 doesn’t seem to work with it, so I’d rather not have to update.

Thank you

Hi,

It looks like you’re using the Synty assets here. 2 things to try here:

  1. Are you stairs using a mesh collider?
  2. Your nodes are very big. I had the same issue. Try make them really small to start off with (0.1) and see if that works.
  3. Make sure your maxSlope and maxStepHeight settings are correct. maxSlope = 90 and maxStepHeight = 0.4f
1 Like

You are awesome sir, thank you.

The nodes did have to be resized to work, AND the stairs came with a MeshCollider, AND I had frozen the creature’s rigidbody constraints on the y-axis due to some bugs earlier on.

Since my game is tile-based, (think XCOM or D&D if you’re familiar with either) do you think it would be easier to just shrink the environments and characters to match the size of the nodes that work, or figure out the math and make my own visual grids on top of the A* grids?

Hi

You shouldn’t have to change the size of your environment. However looking at the screenshot above the nodes do look way too large for an environment like that. It will not be able to distinguish between a stair and some other obstacle.

You will likely want to tweak the ‘max step height’ field.

Great, thank you.

Where is the max step height variable located? I can’t seem to find it in the inspector or the docs.