hi i am truing out some bits and every time i run my game i get this
ArgumentException: Input Axis Horizantal is not setup.
To change the input settings use: Edit → Project Settings → Input
PlayerControler.FixedUpdate () (at Assets/scripts/PlayerControler.cs:8)
bellow is the script i used for the controls:-
using UnityEngine;
using System.Collections;
public class PlayerControler : MonoBehaviour
{
void FixedUpdate()
{
float moveHorizantal = Input.GetAxis (“Horizantal”);
float moveVertical = Input.GetAxis (“vertical”);
Vector3 Movement = new Vector3 (moveHorizantal, moveVertical, 0.0f);
GetComponent().AddForce (Movement);
}
}
plz help
Thank you very nuch
Evenus1
You misspelled “Horizontal”
In every instance of it, you keep putting a A where the 2nd O should be.
Also please use CODE Tags
hi very sorry didnt see that and now it tells me there is a problem with my vertical axis
Vertical needs a capital V.
I’m assuming your rushing or English is not your native language. Either way just take your time expecially working with strings.
this is now my code and it keeps having problems:-
using UnityEngine;
using System.Collections;
public class PlayerControler : MonoBehaviour
{
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 Movement = new Vector3 (moveHorizontal, moveVertical, 0.0f);
GetComponent<Rigidbody>().AddForce (Movement);
}
}
i now dont know whats wrong
also if u see any other errors can you point them out
Well that code should not error, but your movmeant will be unpredictable since your are adding force every physics frame so speed will add up fast.
i get this error:-
ArgumentException: Input Axis vertical is not setup.
To change the input settings use: Edit → Project Settings → Input
PlayerControler.FixedUpdate () (at Assets/scripts/PlayerControler.cs:9)
Hmm according to the error you forgot the capital V, go look in your input settings and make sure the axis is named correctly there.
Edit: forget to save the changes maybe?
TRG96
April 1, 2015, 3:55pm
11
Are you trying “Vertical” with an uppercase “V”?
Try the code from the website Input-GetAxis - Unity Scripting API
i have a V in my vertical input so i dont get what is wrong
Pigny
November 9, 2015, 7:07am
13
It’s been a while, so not sure if you have figured it out yet but…
I think the error is here
Vector3 Movement =newVector3 (moveHorizontal, moveVertical, 0.0f);
It should be:
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
Hope this helps1
Eric5h5
November 9, 2015, 7:14am
14
No, that’s not it at all. The Z axis isn’t vertical, and in any case it’s not an error either way. The error is ‘Input Axis vertical is not setup’, which means there is nothing called “vertical” set up in the input settings. What you have in the code and what you have in the input settings must match, simple as that. And yes it’s been a while. Generally it’s not worth digging up old topics like this since the OP has likely long since moved on.
–Eric
Eric5h5:
No, that’s not it at all. The Z axis isn’t vertical, and in any case it’s not an error either way. The error is ‘Input Axis vertical is not setup’, which means there is nothing called “vertical” set up in the input settings. What you have in the code and what you have in the input settings must match, simple as that. And yes it’s been a while. Generally it’s not worth digging up old topics like this since the OP has likely long since moved on.
–Eric
Debatable. Errors are constant, and 7 years after the first question of the author, I have the same problem
You spelled it “Horizantal”?