Character Movement and Jumping Script?

I have a script that allows for forwards, backwards, left and right movement but I can't jump. It's a third person game, so is there any script that allows jumping but also allows WASD/arrow keys movement?

This is a very basic code structure of how you could get your character to jump.

Add a public variable

`public float JumpSpeed = 100.0f;`

Then write a function for your jump

 void Jump()
    rigidbody.AddForce(Vector3.up *JumpSpeed);


Then in your update function just check if the player has pressed the jump button and if he has execute jump

 if (Input.GetButton(JumpButton)) 

PS - This would only work if your character is has a rigid body component attached to it and not a standard unity controller.

//C# example

private float JUMP_FORCE = 10.0f;
private bool isTouchingMap;

void Update () {

public void jump(){
//rigidbody.AddForce(Vector3.up * JUMP_FORCE);
rigidbody.velocity += Vector3.up * JUMP_FORCE;


The default ThirdPerson-controller in Standard Assets does this.