2D Gameplay... planes or cubes?

Hi there,

I was planning on putting together a 2d game, and I was wondering on the best way to go about making platforms. I was originally planning on have everything as a plane, but I'd like to use some physics and it seems that getting planes to collide can be trouble. With that in mind, should I go about making my platforms using meshes with a depth value of 1 (perhaps with the back and bottom faces deleted)... or is there a better method?

Any advise would be greatly appreciated!

Thanks!

How about this:

  • Create a plane game object
  • Remove the collider component from the plane
  • Add a box collider component instead
  • Make the whole thing into a "platform" prefab
  • Use the prefab to build your levels :)

Unity supplies a 2D Platformer tutorial here. If you use an orthographic camera an align your platforms-as-cubes to it, they'll appear to have no depth. It all depends on the look you're going for, so I'd read the tutorial, which talks about physics a bit, and see how it applies to what you're making.

This is an example of a 2D game without perspective made with Unity.

Here's another.

The physics system doesn't work with planes, and isn't tied to the rendering. Therefore, you'd probably be best off using textures quads for graphics, and sphere, capsule, and box colliders as appropriate. Make the box as deep as you like!