- Home /
Question by
Tony_Blingles · Dec 09, 2013 at 09:03 PM ·
compile-errorscipting
Script Compile Errors
I cannot compile my script to an object. The console returns "The class defined in script file named 'Movement' does not match the file name*!" Here is the code. An exact replica of the code used in the tutorial video. Note, using money to solve the problem is not an option.
**using UnityEngine;
using System.Collections;
public class TransformFunctions : MonoBehaviour
{
public float moveSpeed = 10f;
public float turnSpeed = 50f;
void Update ()
{
if(Input.GetKey(KeyCode.UpArrow))
transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
if(Input.GetKey(KeyCode.DownArrow))
transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime);
if(Input.GetKey(KeyCode.LeftArrow))
transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime);
if(Input.GetKey(KeyCode.RightArrow))
transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
}
}**
Comment