- Home /
Question by
DanickPitre · Mar 08, 2014 at 11:04 PM ·
c#
what is wrong with my script? (C#)
using UnityEngine; using System.Collections;
public class movementChar : MonoBehaviour {
public float PlayerSpeed = 5.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate(Vector3.right * Input.GetAxis("Horizontal") * PlayerSpeed * Time.deltaTime);
}
}
Unity keep saying "Can't add script behaviour movementChar. You need to fix all compile errors in all scripts first!"
Thanks!!!
Comment
This script compiles fine for me. You need to provide us with an copy of the error message output in the Console window. $$anonymous$$ake sure the error is in this file.
It's possible another script has an error in it, it doesn't look like there's anything wrong with this one.