Can someone please help me find out what wrong with my code.
Hi and thank you
I just started using unity and decided to start with the roll a ball tutorial. I was going well until I got to the first script. After doing what he did in the video the ball would not roll so I looked over and there were some miss spells and that sort of stuff. After fixing those I tried it again and still no roll I looked at his code and typed exactly what he had typed and after typing wasd and arrow keys it did not roll after 30 minutes of frustrations I came here.
I am using unity 5.6.2 and my script is in Microsoft Visual Studio
this is my script
using UnityEngine; using System.Collections;
public class PlayerControls : MonoBehaviour {
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Hoizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement);
}
}
one more thing, when I tried playing in unity a little red box showed up in the corner saying
ArgumentException: Input Axis Horizontal is not setup
by the way
using UnityEngine; using System.Collections; public class PlayerControls : MonoBehaviour {
is part of the code
Your answer
Follow this Question
Related Questions
The laser problems 0 Answers
How can I check if a object in the hierarchy have been destroyed using EditorWindow type script ? 1 Answer
Problem with Score/Highscore script 0 Answers
How do i make my enemies face the player? 2D 0 Answers
Help with Script 0 Answers