Question by
HPGBR · Aug 26, 2017 at 01:31 AM ·
unity 5error messageerror-message
Hi. I know there must be other topics about this, but I insist on asking, because I can not find a solution. I was creating a game and I made this script:
using System.Collections;
using UnityEngine;
public class Lanterna : MonoBehaviour {
void Update () {
if (Input.GetKeyDown ("f")) {
if (light.enabled == true){
Light.enabled = false;
}else if (light.enabled == false){
light.enabled = true;
}
}
}
}
And this error appears:
Assets/scripts/Lanterna.cs(9,11): error CS1061: Type UnityEngine.Component' does not contain a definition for
enabled' and no extension method enabled' of type
UnityEngine.Component' could be found. Are you missing an assembly reference?
Can someone help me? I would appreciate
Comment