Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: coxy17 on March 04, 2014, 05:46:44 PM

Title: Activate Game Object Using Tag/Global Variable [SOLVED]
Post by: coxy17 on March 04, 2014, 05:46:44 PM
Hi, Ive read through the other posts regarding activating/de-activating multiple objects at once using a tag or global variable. But none answer my query.

I have got the FSM setup and got it to work with manually by setting the GameObject in the 'ActivateGameObject' action.

I want to disable 4 objects at once so ive tried to set a global variable but this only works for one object at a time.

Ive noticed there is a option to use 'tags' but not sure if this would work? could I use tag count?

Thanks

Nick

Title: Re: Activate Game Object Using Tag/Global Variable
Post by: jeanfabre on March 05, 2014, 02:47:47 AM
Hi,

 you can't deactivate several objects in one go ( one action), unless they are in the same hierarhchy and you disable on of their parents,

you can use tag, you could do a while loop of some sort that as long as you find a gamobject of a given tag you keep disabling, but that's dangerous.

 instead I would fire a global event for these object to catch and disable themselves if it applies for them. If you have a small number of objects that's ok.

bye,

 Jean
Title: Re: Activate Game Object Using Tag/Global Variable
Post by: coxy17 on March 05, 2014, 09:19:21 AM
ok, will try what you suggested with the global event. Does disabling more than a few objects cause issues? performance wise?

Nick
Title: Re: Activate Game Object Using Tag/Global Variable
Post by: jeanfabre on March 05, 2014, 11:54:27 PM
Hi,

 no, what cause performances hick ups is creating destroying objects, so disabling enabling is the way to go.

bye,

 Jean
Title: Re: Activate Game Object Using Tag/Global Variable
Post by: coxy17 on March 06, 2014, 11:37:08 AM
Hi Jean,

The global variable worked

Thanks

Nick