- Home /
Using 2D physics in 2D isometric game in 3D space
Our team is trying to create an isometric action game with 3D objects in it. We are inspired by the look of "Shadowrun: Returns" which is made in Unity:
But when I tried to implement similar mechanics, I've stumbled upon the following issues:
2D physics work ONLY in the XY plane which would fit a platformer, but in our case the physics should take place in horizontal space only. I think it's not the case with "Shadowrun" since it's a turn-based game with no physics involved.
If the Y-axis is used as a horizontal one (and, respectively, Z as the vertical), then the camera in the unity viewport behaves wrong and rolls instead of yawing (which surely is a lot of pain for our level-designer), and importing 3d models becomes quite tedious since we have to rotate them before importing.
If the floor is placed in the XZ axis like it is supposed to be in 3D space, then we aren't able to use 2D physics simply because such things as Rigidbody2D don't use Z-axis.
Here is a screenshot to visualize the issues better (I'd have uploaded more but the site won't allow me):
What doesn't seem like a viable solution for us:
Rendering our animated models as sprites and putting the entire game in 2D space. We are going to use a lot of combined animations (like walking and aiming a gun at the same time) and rendering every combination in 8 direction would be an insane waste of time and memory.
Using 3D physics. It seems like we'll have to pick this solution but it is quite irrational to involve the third axis in game where all the action takes place only in a horizontal plane. Furthermore, we'll have to adapt our 2D tilemap system to 3D colliders somehow in order to make it interact with 3D objects.
Designing levels in XZ plane and using a script to automatically snap it into XY plane just before the game starts in order to make the 2D physics work. This is just a horrible kludge, isn't it?
I have found no similar questions that cover the exact issues I described above, so I hope to find a solution here. This question's answer confirms that shadowrun indeed uses 3d characters with 2d sprites but it's still unclear for me how exactly it works with the unity's coordinate system and what happens to physics.
Your answer
Follow this Question
Related Questions
I need no perspective distortion for some part of screen 0 Answers
Make part of terrain transparent. 1 Answer
Player stucked in walls Unity 1 Answer
Sorting irregular objects in 2D isometric view 0 Answers
Tilemap sorting of individual tiles 0 Answers