# Illusion of Jump, height, and depth for 2d top-down

Hello, everyone!

I am having a hard time trying to figure out the logic to have the illusion of the player jump on objects or surfaces that are varied in height for a 2d Top-down.

The player would be able to jump back down and also jump back up if needed. This boggles my mind.

Does this mechanic have to do with the z-axis?

Any piece of information is muchly appreciated!

For true top down 2d I would just adjust the size of the player as its â€śheightâ€ť increases.

1 Like

That, a good illusion would be the closest to camera the object is, the smaller,

I have a jump mechanic done for 2d top-down actually. Although I have yet to get it to â€śland on objectsâ€ť I can show a jump. The way to do it is to have a player object, and a shadow object for the player object. I would group these two in a MainPlayerObject (that has nothing in it but transform we donâ€™t need), and for jump, just move the player object ( that contains the playerâ€™s sprite) to move on the Y-Axis up depending on whatever jumping height variable you can allocate via public, and move it slowly with Time.deltaTime, up by subtracting the jumping height variable from whatever number to 0 and back down you can bring the jumping height variable from 0 to whatever number was assigned (Or reverse order would be fine now that I think about itâ€¦), make sure to keep the â€śxâ€ť velocity of the sprite object to move along with the y velocity too. You subtract y velocity with the jumping height variable times Time.deltaTime.

If you can figure out how to get the landing on an object bit, I am thinking it would have something to do with moving the shadow sprite object onto the object, by assigning its transform into the objectâ€™s height PLUS the shadowâ€™s Y position upon collision.

Im not sure. Please do let me know what you find.

or just cheat and use 3d #ez lighting