Super Ghouls 'n Ghosts style jumps & double jumps?

Hey everyone,

I’m very new to coding and build games in general so please try to overlook how terrible I am but I need some help coding a jump and double jump system that replicates how the jumps are in the classic Super Ghouls 'n Ghosts. The code I have right now creates a jump arc to the right, left & I also have a ‘neutral’ jump but this code uses rigibody2d.AddForce which means its not exactly the same everytime. This also means when I added a double jump the player was just nudged instead of given a new speed and direction.

Can someone give me an idea of how I can replicate the system from SG’nG in c#?

Thanks in advanced!

Joe.

Instead of using AddForce. Try changing the velocity directly.

Whenever I use PlayerRb.velocity = new Vector3(0, 1, 0); I only ever get vertical movement even if i change the value of the x to PlayerRb.velocity = new Vector3(1, 1, 0) nothing happens on the x when i jump. Could someone explain to me why this doesn’t work or what I’m not understanding?