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

Error putting an object into an Array

$
0
0
So I'm trying to put an Object into an Array for use later and I'm getting an error every time I try. Here's my code: var children : GameObject[]; var temp : GameObject; function Start () { children[0] = transform.Find(this.name).Find("Teal Circle Sprite").gameObject; Debug.Log("Name of object is" + children[0].name); } Here's the error that I'm getting: NullReferenceException: Object reference not set to an instance of an object Dot.Start () (at Assets/Scripts/Dot.js:8) Some more information: The name of the class is Dot and the object in question has a child called "Teal Circle Sprite" Any help would be great! Sorry I'm kind of new at Unity!

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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