Hi, I am getting the message Error CS0116 but I don’t know what is wrong since it is the only error statement in the console. Please help me as Iam new to unity and Iam trying to make a simple car game.Here is my script:–
Your code is not within a class. Create a new script and do not delete the stuff already in there, except for the Start() and Update() functions if you do not need them. The class name also needs to match the file name.
Your code should be in something like this:
using UnityEngine;
public class MyClass : MonoBehaviour {
// your code here
}
That code has a few errors and issues. You should try to see some scripting tutorials, basics.