- Home /
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.
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?
Hey joechessum
I've been trying to code this jumps on and off for months and keep giving up and trying to do it again but i can't seem to get it could you please help me with the code or at least understand what I need to do in order to at least do a single SGnG styled jump.
Do you have any other scripts that are modifying the x velocity, like a player controller script?
Answer by Spinnernicholas · Nov 26, 2013 at 09:54 PM
Instead of using AddForce. Try changing the velocity directly.
Ah yes I changed it to rigibody2D.velocity and now have the jump and double jump sorted. Cheers!
Any view on the code? I'm interested in seeing what it looks like!
Your answer
Follow this Question
Related Questions
Character doesn't jump repeatedly 1 Answer
2d Beat Em Up Jump Functionality 0 Answers
I only want my character to jump when touching the ground 4 Answers
How do i incorporate a double jump ingame? 1 Answer
Input.GetButton not working 1 Answer