How to make a 2D Collider for a sprite parallel to the floor?

Hi!

I have made a hexagon composed grid and I need to add a collider to each hexagon

The problem is that I need the grid to be parallel to the floor, and 2D colliders only work on vertical surfaces, so I was wondering what would be the optimal collider I should use.

Thanks for the help!

Two options. Since it is going to be 3D space (and I assume the rest of your game is too otherwise you wouldn’t be asking this question) you just use regular colliders. A box collider is simple enough that you won’t get any over head. Or you could do what the the quad does when you make one which is use a mesh collider of the quad. If you need it to be the exact shape of the the sprite then you will need to go into a 3D modelling engine and make a hex plane mesh and use a mesh collider on that. Those are your only options.

… now if you only need the 2D rigidbodies to act with the mouse or other 2D physics then there is another option (though I don’t recommend it because unity math then gets tricky). You change how you build your game, basically you make the Z axis up and down while Y and X are forward and right.