[quote="Carlos182":1s3jhtx9]I was dealing with that problem but I fixed with this, check it out:
When Z key was pressed and Player is on ground, set a GravityTimer to 10
If GravityTimer > 0, Substract 1 from GravityTimer
If GravityTimer = 0, set vertical speed to 0
If Z key is released, set vertical speed to 0.
That way, if you keep the button pressed, you will jump the same height you wanted, but if you release the button, the player will stop.
Just play with that values (GravityTimer and that stuff) and you'll get what you want, or atleast I did.
I read the thread you started about it, but I couldn't get the right values either (and I suspect events are better for this anyway). I don't see GravityTimer or Vertical Speed anywhere though. Did you use private variables?