Question by
conroar94 · Nov 23, 2015 at 12:41 PM ·
error messagesymbol
I keep getting a "unepected symbol ';' in class, struct or interface member " error i dont understand why
using UnityEngine;
using System.Collections;
public class scrollSpeed : MonoBehaviour {
scrollSpeed;
// Use this for initialization
void Start () {
transform.Translate (new Vector3 (-1, 0, 0) * Time.deltaTime * scrollSpeed);
}
// Update is called once per frame
void Update () {
}
}
Comment
try formatting ALL of your code when post here - it's hard to read, and therefore be able to help you.
Randomly stating the classname inside the class itself could cause an issue.
Specify the type of object 'scrollSpeed' is (int, float, etc.).
Answer by Jessespike · Nov 24, 2015 at 06:32 PM
As other have pointed out:
You have an unspecified variable that has the same name as the class on line 5. Change the variable name and specify it's type.
public class scrollSpeed : MonoBehaviour {
float speed = 1f;
// Use this for initialization
void Start () {
transform.Translate (new Vector3(-1, 0, 0) * Time.deltaTime * speed);
}
}
Your answer
Follow this Question
Related Questions
error CS1525: Unexpected symbol `offsetX' 1 Answer
Urgent Help Error cs1525! 1 Answer
unexpected symbol && 2 Answers
how do i fix error1519 1 Answer
Getting error on lap counter script JS 0 Answers