So first time using unity and scripting also, I have managed to work out my problems just be fiddling with the script and using the database thing it takes you to when you get an error. I have finished the script and hit the play mode and the ball doesn’t move at all and if it is because there is a zero value somewhere then can someone tell me where to find it? Below is the script, I didn’t copy and paste it from tutorial, I manually input it myself, twice and if there is an error then it is not popping up or I cannot find it.
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis(“Horizontal”);
float moveVertical = Input.GetAxis(“Vertical”);
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}