Grid graph 2d game

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


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


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 ?


You can read more about the layers in the get started guide:
Look at the Collision Testing and Height Testing sections.