Reputation: 1
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