Hi I'm currently trying to get a double jump feature in my game. I'm using the default First Person Controller. I've looked around and someone suggested this but I'm not sure where to put it. Code (csharp): function DoubleJump{ Jump(); Jump(); } Any help would be appreciated. Also has anyone translated the FPC into c#? Not so good with JavaScript.
Wel for a double jump you don't want to call the jump function twice. You want to have the player have the ability to call it whenever he/she presses the key in the air. For instance, right now in the script, the function can only be called when the player controller is grounded. So you could make a variable called doubleJumped : boolean; and when you're player is in the air, if this value is false you can call the jump function again (maybe reduce the power but that's not necessary) so you can only double jump once per jump And when the player becomes grounded again the doubleJumped value turns false If you have any more questions feel free to PM me, I'm moderately active. Good Luck
Could you point me in the code where I can see the grounded part? I'm not sure what part relates to the jumping.