I’m doing the Roll-a-Ball tutorial for a class I’m taking. A couple days ago, all of my scripts worked fine. I turn it on tonight, and none of them work. I haven’t changed a thing, and I have no idea what happened. Any help?
Player movement script
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour
{
public float speed;
void Update ()
{
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rigidbody.AddForce (movement * speed * Time.deltaTime);
}
}
Camera follows player
using UnityEngine;
using System.Collections;
public class CameraControl : MonoBehaviour
{
public GameObject player;
private Vector3 offset;
// Use this for initialization
void Start ()
{
offset = transform.position;
}
// Update is called once per frame
void lateUpdate () {
transform.position = player.transform.position + offset;
}
}
Script to make items rotate
using UnityEngine;
using System.Collections;
public class rotation : MonoBehaviour {
// Update is called once per frame
void Update () {
transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime);
}
}