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
I honestly dont know what else to do people! Please help!