So I'm just starting to try to learn unity development with C# using this tutorial but I cant add the script to any game object and I get the following error:

Code of the script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
public Light myLight;

void Update()
{
if (Input.GetKey("space"))
{
myLight.enabled = true;
}
else
{
myLight.enabled = false;
}
}
}


I know it's been answered before but I've done everything I read, I did my homework and I still cant get around this issue. I allready checked the name of the class and its the same as the file's name. I think it may be something regarding installation (?) I installed unity hub and it installed Unity and Microsoft Visual Studio by itself.

• Unity version: 2019.3.3f1
• MS Visual Studio version: 16.4.5
• MS Net Framework version: 4.7.03062

• If you have no compiler errors, try closing Unity, deleting the "Library" folder in your project, then opening Unity again to force it to re-import everything. This can clear issues with no apparent cause in the source assets. Mar 6, 2020 at 1:07
• Why do you use a tutorial that is 5 years old? Mar 6, 2020 at 2:43