Top-down 3D game with 2D physics?

Hi,

I’d like to make a top-down game that is 3D (uses perspective camera etc.), but with 2D physics. The physics side of things doesn’t need to be in 3D at all, so I want to avoid using the more expensive 3D physics and locking the translation/rotation axes… especially as this is targeting mobile.

The problem is that Unity’s 2D physics is stuck in the XY plane (side-scroller), and there is no option to swap it to act in the XZ plane (so that Y is up in the 3D graphical world). So what are my options here?

Do I just stick with the 2D physics being in the XY plane and treat Z is up (not ideal as Unity treats Y as up for most 3D things). I’d also have to bring in art assets rotated so that Z is up right (I’d rather not have to apply rotations to everything to compensate).

Or is there some other way?

I was toying with the idea of splitting the graphics and physics representations of my objects up. So my car/tank/whatever is actually two separate gameobjects - one with a rigidbody2d that moves around in XY plane and does all the physics/movement. And another that is just the graphics part, and I just set the transform on it based on the physics one accordingly, remapping so that Y is up for the model… Seems overkill though, and would massively increase the number of gameobjects potentially.

Disappointed that Unity doesn’t provide the option to choose the 2D physics plane - not every 2D game is a side-scroller! :slight_smile:

Stupid question: If you are using 3D perspective and all … why not use 3D physics as well?

Because I just don’t need 3D physics, and the added computation it brings (even if locked to an axis). 2D physics (Box2D) is much cheaper, and that’s important for mobile.

Physx is more than fast enough unless you’re throwing around hundreds. In any case if you’re sure then the only way is to rotate your level so it’s facing back view.

It’s only marginally cheaper, actually.

–Eric

Do you happen to have a link to any comparisons for this? Some performance/timing figures?

I think because of the individual nature of each project you might be better off simply setting up a few test scenes with the upper amounts of stress you expect from your game. then run it through the profiler or even better yet - simply test it on your device directly if possible.

Wes MecDermot’s Book about Game Creation with Unity and modo actually contains a few interesting ideas on what to keep in mind when developing on mobile and how he checked for the numbers relevant to his project. It’s only a very small portion of the book but very interesting, non the less. :slight_smile: