Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: dennisli168 on June 09, 2012, 10:56:28 AM

Title: find inactive gameObject
Post by: dennisli168 on June 09, 2012, 10:56:28 AM
I'm setting up a preloaded pool of gameObejcts using playmaker.

Is there another way to get inactive gameObjects besides using getRandomChild?

So far that is the only action that worked for me, none of the other get child or find object actions works on inactive gameObejcts. This one works but it is not very efficient, since you can't define the name of the gameObject.

Also, getRandomChild gets gameObjects that are already detached from their original parents. Is this a bug? I would think that since a gameObject is detached from its parent, logically it would no longer be one of its child.
Thank you!
Title: Re: find inactive gameObject
Post by: jeanfabre on June 09, 2012, 02:42:15 PM
Hi,

 to access inactive gameObjects, you need to store there reference prior deactivating them, else you can't get to them.

 For this you can use arrayMayker, and store in an array all your gameObject you are going to deactivate so that you can get back to them.

https://hutonggames.fogbugz.com/default.asp?W715 (https://hutonggames.fogbugz.com/default.asp?W715)


As far as randomchild getting non child gameObject, that's odd indeed.


bye,

Jean