Quantcast
Viewing all articles
Browse latest Browse all 112

trouble getting all children into an array.

I'm trying to get all the children of an object into a Transform[] variable like so: #pragma strict var tiles:Transform[]; function Start () { tiles = gameObject.GetComponentsInChildren(Transform) as Transform[]; } I'm not sure about the "as Transform[];" bit, but I get a warning about implicit downcasting from component to transform if I don't have that in there. anyway, I don't get any errors but when I run that, nothing happens, and I don't know why.

Viewing all articles
Browse latest Browse all 112

Trending Articles



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