- Home /
How do you make a prolonged jump script in JavaScript?
I am trying to make a game that will be similar to Robot Unicorn Attack with a jump function that will increase the hight if you hold down the jump button longer. Does anyone know how to make a good javascript for this?
Answer by Statement · Mar 08, 2011 at 01:49 PM
An idea is that you provide an AnimationCurve you can set through the inspector. It would represent climb rate or jump height. While holding down the jump button you could move through and evaluate the height or climb over time, so it might eventually level out. When not holding down the jump button, just apply some gravity.
Your answer
Follow this Question
Related Questions
How to make a jump and a rotation using javascript? 2 Answers
Particular "Jump" Script. 2 Answers
Player sticks to ground occasionally after trying to jump 0 Answers
Jump Distance 1 Answer
Make a ball jump on plane collision 1 Answer