- Home /
Hey, I'm currently doing the Space Shooter tutorial with Unity 5 but I keep getting this error when I attempt to run the script.
All compiler errors have to be fixed before you can enter playmode! UnityEditor.SceneView:ShowCompileErrorNotification()
This is my script:
using UnityEngine; using System.Collections;
public class PlayerController : MonoBehaviour { public float speed;
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
GetComponent<Rigidbody>().velocity = movement*speed;
}
}
What am I doing wrong?
Fix the errors? It could be in any script. What are they and their line numbers?
This is the first script I have written. There are no other scripts in my project.
Assets/Scripts/PlayerController.cs(16,1): error CS8025: Parsing error
Thanks I managed to fix it... it was just a parsing error.
Answer by Digital-Phantom · Mar 16, 2015 at 07:34 AM
If you imported the tutorial assets then the scripts that came with it are wrong. At least wrong if you are using unity5.
There is an option when importing earlier assets/packages to auto correct any API issues. I had a similar problem and doing this sorted it.