as a total beginner I just finished my very first project (small tower defense game) nothing special but
guess it was the right choice to lern some basics.
Now I want to move on and start working on a tiny 2D Zelda like action-adventure.
I really want to add features like bridges with crossable paths on the ground level and the possibility to jump off the hill / bridge to the ground (atleast on specific areas).
That’s just a random picture I googled to clarify how it could look:
While watching diffrent 2D-RPG tutorials I noticed none of them had even mentioned someting close to that topic.
I’m not sure if it is even possible doing diffrent height-levels while using a Unity 2D project.
Well, any ideas/hints how to realize that in a 2D project or would you recommand to create it in 3D?
If someone knows a suitable tutorial I would also be thankfull for that, could not find one.
But maybe i searched with the wrong keywords
If you are using sprites as in the image your posted then having the character gain height would still be a translation on the Y axis. To help sell that the movement is a change in height, and not North-South movement you could do something like changing the character’s scale, or possibly a drop shadow under the character. Increasing the distance between the character and the shadow would then indicate that the character was gaining in height.
Scaling the sprites because it is closer to the camera makes totally sense, have not thought about that.
Thanks that was already some good input.
But how do I realise the Bridge itself? Currently i have 2 problems with it (sorry for not being specific enough in the first post).
1: depending on the states “crossing the bridge” or “walking underneath the bridge” the sorting layer of the bridge are diffrent and dependent on the player position (or enemies which are running around)
how are the collider working in that case? If the bridge has a handrail the collider would deny the ability to jump down but also would blocking the path to walk underneath it. Same problem with the wall of the hill
vise versa.
Hopefully my explanations are not too confusing.
There are a variety of ways to accomplish walking over/under the bridge. You could have a colliders acting as triggers and when something enters them, set the sorting layer appropriately. So the ones at the ends of the bridge set the layer to one above the bridge’s sorting layer, and the ones at the side would set it to one below the bridge.
As for handrails on the bridge, those would just be a sprite with a collider on it that would prevent the character from walking off the side of the bridge.