Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

I am trying to enable multiple scripts from different objects that have the same tag by using javascript. I keep getting a NullReferenceException: Object reference not set to an instance of an object LightPickup.js:37. What am i doing wrong?

$
0
0
var varGameObject = gameObject.FindGameObjectsWithTag("Flashlight"); if(Input.GetKeyDown("e")) { for (var obj : GameObject in varGameObject) { obj.GetComponent.().enabled = true; obj.GetComponent.().enabled = true; }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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