How do I fix the error in my Player Controller?

Here’s the code I wrote for my character controller:

using UnityEngine;

using System.Collections;

public class FirstPersonController : MonoBehaviour {

public float movementSpeed = 5.0f;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

	float forwardSpeed = Input.GetAxis("Verical") * movementSpeed;
	float sideSpeed = Input.GetAxis("Horizontal") * movementSpeed;
	
	Vector3 speed = new Vector3( sideSpeed, 0, forwardSpeed );
	
	CharacterController cc = GetComponent<CharacterController>();
	
	cc.SimpleMove( speed );
	
}

}

And when I try to move my character I can’t move and I get this error:

UnityException: Input Axis Vertical is not setup.
To change the imput setting use: Edit → Project Settings → Input
FirstPersonController.Update () (at Assets/Script/FirstPersonController.cs:16)

Can you help me fix my problem.

You spelled vertical wrong. It is this:

float forwardSpeed = Input.GetAxis("Verical") * movementSpeed;

It should be this:

float forwardSpeed = Input.GetAxis("Vertical") * movementSpeed;

you have a typo in:

float forwardSpeed = Input.GetAxis("Verical") * movementSpeed;

is this right in your original script? change “Verical” to “Vertical”:

float forwardSpeed = Input.GetAxis("Vertical") * movementSpeed;

it should be setup by default if not, do what the error tells you :wink: