Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 30 Dec 2015 06:19 AM |
Does anybody know how to go about creating a double-jump mechanic in a game? I'm also hoping to animate the jump. How do I ensure the double-jump lasts long enough to play the animation? (I was thinking of a animating the Player to twirl around as they double-jump)
Any help or advise would be greatly appreciated. Thanks in advance. |
|
|
| Report Abuse |
|
|
Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 30 Dec 2015 06:37 AM |
*(I was thinking of animating the Player to twirl around as they double-jump)
Does anybody know how to make a double-jump?
|
|
|
| Report Abuse |
|
|
rvox
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 5380 |
|
|
| 30 Dec 2015 06:39 AM |
you can detect when they are already jumping and listen for another spacebar press
then add a bodyforce to the character
just cframe the torso to make it spin |
|
|
| Report Abuse |
|
|
Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 30 Dec 2015 06:42 AM |
How do I use Bodyforce? Should I use Instance.new(), or have the Bodyforce permanently in the Player's Character? |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2015 07:00 AM |
local UIS = game:GetService("UserInputService") local Human = game.Players.LocalPlayer.Character:WaitForChild("Humanoid") UIS.InputBegan:connect(function(key,GPE) if not GPE and key.KeyCode == Enum.KeyCode.Space then if not GPE and key.KeyCode == Enum.KeyCode.Space and Human.Jump == true then -- Make them double jump here by adding BodyVelocity end end end)
~IanSplodge, Walrus God of the Forums. |
|
|
| Report Abuse |
|
|
Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 30 Dec 2015 07:16 AM |
@IanSplodge
Thanks for the suggestion.
Does this go into StarterPlayerScripts as a LocalScript, or does this code get inserted into StarterPlayerScripts -> ControlScript -> MasterControl?
There is also a lot of LocalScripts within MasterControl, named as follows: DPad; Gamepad; KeyboardMovement; Thumbpad; Thumbstick; TouchJump; VehicleController.
So, where does this code go? |
|
|
| Report Abuse |
|
|