- Home /
Input Axis vertical not defined
Hi I made a new car controller script in Unity 5
public float speed =10.0f; public float reverseSpeed =5.0f; public float turnSpeed =0.6f;
private float moveDirection =0.0f;
private float turnDirection =0.0f;
private Rigidbody rb;
// Use this for initialization
void Start () {
rb= GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update ()
{
moveDirection = Input.GetAxis("vertical") * speed ;
rb.AddRelativeForce(0,0, moveDirection);
}
Initiall the console does not show any error and the game mode starts but then the car does not move and the error pops up at the bottom
Input Axis vertical not defined
Answer by allenallenallen · Aug 07, 2015 at 04:14 PM
By default, Unity has an input called "Vertical" with a capitalized V, not lowercase. That's the problem.
I have a screenshot here to add or modify your inputs if you need to do so.
Your answer
Follow this Question
Related Questions
`Input' does not contain a definition for `GetAxis' 2 Answers
Input.GetAxis("Vertical") on touch devices. 2 Answers
Is it possible to work around Input.getAxis always returning 0 after scene loads? 4 Answers
How to set text when i want? 1 Answer
Game doesn't recognize X-axis input from XBox 360 controller 1 Answer