|
So why can one use Blah = GameObject.FindWithTag("Blah").transform, but you can't use Blah = GameObject.FindGameObjectsWithTag("Blah").transform? What's the difference, and is there a simple workaround for finding the transforms of multiple objects with the same tag? Thanks
(comments are locked)
|
find objects returns an array not a single object to use. Thank you, appreciate it ;)
Apr 22 '11 at 01:11 AM
superventure
(comments are locked)
|
|
You can use Array.ConvertAll() I don't think you can do this? GameObject can't just be cast to Transform, you need to get the transform member of it.
Apr 22 '11 at 09:45 AM
superpig
That's what I'm doing. The converter inputs a GameObject and returns the attached Transform component.
Apr 22 '11 at 10:00 AM
Peter G
Oh, my bad - my browser was cutting off the rightmost part of your code, so I didn't see the second argument to Array.ConvertAll(). :-)
Apr 22 '11 at 06:43 PM
superpig
(comments are locked)
|
|
Also LINQ (if you aren't targeting mobile):
(comments are locked)
|

yes by using an array []