Quantcast
Channel: Answers by "khenkel"
Viewing all articles
Browse latest Browse all 47

Answer by khenkel

$
0
0
Try renaming the GameObject to something else, because "light" is already used. Every GameObject has a light variable by default (doesn't matter if it exists or not) and you're trying to access it. Check this for more info: http://docs.unity3d.com/ScriptReference/GameObject-light.html **EDIT:** Also if you want to disable/enable a GameObject, you have to use **obj.SetActive(true/false)**, because **obj.enabled** doesn't work here.

Viewing all articles
Browse latest Browse all 47

Trending Articles



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