I am having a problem to where im trying to make a double jump script. Here is the script
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
public GameObject Character;
public float jumpSpeed = 5f;
public float Speed = 5f;
public bool canControl;
int jumpCount = 1;
void Update()
{
if(canControl == true)
{
float h = Input.GetAxis("Horizontal") * Speed;
Character.transform.Translate(h*Time.deltaTime,0,0);
}
if (Input.GetKeyDown(KeyCode.W) && jumpCount < 3) {
Jump ();
jumpCount += 1;
}
}
void Jump(){
GetComponent<Rigidbody>().AddForce(Vector3.up * jumpSpeed);
}
}