John Peters
John Peters

Reputation: 1

CS0589 unexpected syntax error in Unity3d

I am totally new to Unity and at the moment i am taking a course at Udemy. In course we have to create a game like flappy bird. We have created an object which has to move from right to left. Then we made a script which is as follow:

using UnityEngine;

public class Object : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
    transform.Translate(Vector3.left * (20 * Time.deltaTime));
}
}

The next thing we have to do connect this script to the object but than it goes wrong. It won't let me do that because there is an error in it. The error should be on line of the public class, but the teacher has the same code and it works for him. Is there something i am missing. This is very frustrating. Thanks in advance.

Upvotes: 0

Views: 184

Answers (1)

Vect0rZ
Vect0rZ

Reputation: 401

According to

CS0589

The compiler found unexpected syntax.

I guess this have to do with this line.

public class Object : MonoBehaviour

Object is a default type in C#. Try chaning the name of the class.

Upvotes: 2

Related Questions