Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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
-
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
-
ok, will try what you suggested with the global event. Does disabling more than a few objects cause issues? performance wise?
Nick
-
Hi,
no, what cause performances hick ups is creating destroying objects, so disabling enabling is the way to go.
bye,
Jean
-
Hi Jean,
The global variable worked
Thanks
Nick