Hi there! I’m using AddForce to make the character dash forward when the space key is pressed. But when I press the space key the player won’t move at all. Does anyone know how to fix the problem? Thanks!`
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetButtonDown ("Q")) {
dash ();
}
}
void dash ()
{
Vector3 dash = new Vector3 (0, 0, 100);
dash = transform.rotation * dash;
RigidBody rb = GetComponent<RigidBody>();
rb.AddForce (dash);
}`