Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

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:

$
0
0
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

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>