Hi. I’m trying to make a game that works like Golden Axe, but I’m having issues when I try to implement walking along the Z axis while having raised platforms the player is supposed to be able to jump onto.
See 1:25 in this video to see what I mean.
Is there any way I can implement this in Unity without having to switch to 3D?
Any guidance will be much appreciated.
Golden Axe is using 3D physics. Whether to not it’s “true” 3D, or a 2D illusion, it still has 3 dimensions of perceived movement going on. If it was a 2D game with 2D graphics, it wouldn’t be 2.5D as you’ve described it.
Unity is a fully featured 3D engine, and there’s no need to use 2D colliders for this unless you specifically want to do that as a challenge. If that’s the case, then you’ll have to create a custom 2D system for walkable areas and height transitions in order to create the illusion of a 3rd dimension that can work with Unity’s 2D physics.
I think you’ll save yourself a lot of headache if you do in fact switch to 3D colliders. You can keep all the art as 2D pixel art. You would only have to rotate the sprites and orthographic camera at an angle on the X axis that matches the artwork’s perspective (maybe 45 degrees?) to align them with the colliders.
This way, you can leverage the full extent of Unity’s 3D physics features and components right out of the box. There’s no need to reinvent the wheel. Gravity will just work, collisions and platform traversal will just work, level creation will be easy.
And if you need any colliders to be non-primitive shapes, you can either use multiple primitives, or use ProBuilder to generate a simple mesh to use as a mesh collider in lieu of a polygon collider.
3 Likes
Yeah, that’s what I thought.
Emulating 2.5D with raised platforms in 2D is pretty viable as long as the game doesn’t have jumping (either reaching them via ramps or stairs), but if you do have jumping, things get nasty.
Guess I’ll have to switch to 3D then.
Thanks for the tip.
EDIT: One more question, is it possible to have the level layout designed in 2D with tiles, and lay down 3D colliders on top of it?
You can definitely create a level editor any way you like, as long as you are able to convert from your chosen format to the real playable level.
For Tilemap, I suppose you could paint custom tiles that will spawn a configured prefab at runtime, or use the example Prefab brush in the 2D Extras repo to paint & spawn them at edit time.