- Home /
Jump Speed
Hi i have a jumping script which works fine, however the character feels more like jumping on the moon :-) I want to add a Jumpspeed to increase the speed when the character jumps up and a gravity force to choose how fast the character falls to the ground.
my current script is:
static var PlayerState : int;
static var ButtonJump = false;
function Update () {
// jumping controls
if(Input.GetButtonDown("Fire1"))
ButtonJump = true;
if(ButtonJump == true && (grounded == true)){
rigidbody.velocity = Vector3(0,jumpHeight,0);
// (playerSpeed Input.GetAxis("Horizontal")) Time.deltaTime;
grounded = false;
ButtonJump = false;
}
Answer by Dreave · Mar 29, 2012 at 06:40 PM
If you use the fps controller it already has a jump script attached to it as well as movement speed and so on, but there is an option called gravity that you can change which is exactly what you want.
i don't really want to use a controller since when i tried using aq character controller my collisions didn't work anymore and so on isn't it possible to implement these two functions into my script some how ?
Your answer
![](https://koobas.hobune.stream/wayback/20220613065708im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How To Create Buttons 1 Answer
Character fall animation 1 Answer
Player movement 0 Answers
Lerp & jumping with sin/cos 1 Answer