Question! Please Help

hey guys! so im trying to design a 2d app and im sorta struggling with 1 piece of it …

In This Image are 3 lines

The Default Line would be where the players default position on the screen would be every time they jump or dive they return to this point … i guess in the same concept of when you jump your gravity pulls you back to the ground

The Jump Line works as intended i guess using the “Jump” Function but isn’t really ideal atm.

The Dive Line so instead of jumping it would basically do a reverse jump… in the -z axis

I know what i want but im struggling to come up with how i would … execute what im after. any tips or tricks would be apperciated if you know any tutorials or anything.
thankyou in advance

EDIT: forgot to say what i want is for it to say if i press W it to do an upward jump and if i press S it does a dive.

A dive into what? like laying down on the ground or moving the character under ground? I’m confused what you mean by Dive. do you mean you want them to swim? please give more info on what you are trying to do?

defaulkt movement line would be swimming in a straight line… when the path is blocked i want the player to be able to dive under the blockade as if it was a reverse jump… by this i mean i want them to go down and back up in an arch determined on the forward movement speed… does this help clarify?

for dive and jump i think, you can use a Math Sin to generate an equal dive and jump arc over time, that adds the positiv or negative sin value for breaking the default move line into jump/dive (what an ugly sentence…).

i laughed a little at your last comment