How to avoid connection between steps and only use ramps?

Hello and sorry for asking your help again !

I am currently learning how to use this useful asset but I have a problem with the grid graph (and in this cas the layered one).

My project is tiled based and I want some units to only use ramps. The problem is the picture: a connexion is made between two nodes as the points coordinates are on the climb setting. But there is a step… And I don’t wan’t to allow climbing those steps.

The second part of the picture show the collider I’ve added.

But the problem is still the same… Can you help me?

Thank you!

I was thinking… Is there a way to avoid two nodes connexions?

I don’t think there is raycast between nodes, my test to add a obstacle between them was a complete failure.

Hi

Currently it is impossible for the graph to distinguish between the two cases.
If you have a game-specific way of detecting the difference then you can modify the GridGraph.IsValidConnection method to use that. Alternatively you can subclass the GridGraph class and override that method.

Wow, impressive.

Everything is clearly coded and… easily extendable!

Thank you for you tip! Right now I’ve added a wall system between nodes by creating my own LayerGridGraph extending the base one, a custom editor extending the base one with a little tag selection for the wall and everything works like a charm with so little lines of code…

Thank you! Thank you! Thank you! Thank you!

Thank you for the kind words :slight_smile:

If you like the package one of the best ways to further support it is to rate it on the Asset Store and/or leave a review :slight_smile:.

Good luck with your game!