Grid graph 2d game

how to generate a 2d graph for my 2d game ?

Hi

You can rotate the graph in the editor to match the XY plane.
Also make sure you have the toggle “Use 2D Physics” checked.

yes i did rotate it and everything but it didn’t recognize the obstacles, i put 2d colliders around them but it just considered everything walk able

Hi

Are you sure they were in the correct layers?

1D colliders (e.g edge colliders) cannot be detected unfortunately (Unity limitation).

i only used 2d colliders around the obstacles and one around the main background…
can you tell me more about the correct layers, or tell me where to look for them ?

Hi

You can read more about the layers in the get started guide:
http://arongranberg.com/astar/docs/getstarted.php
Look at the Collision Testing and Height Testing sections.