playMaker

Author Topic: Activate Game Object Using Tag/Global Variable [SOLVED]  (Read 2077 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Activate Game Object Using Tag/Global Variable [SOLVED]
« 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

« Last Edit: March 06, 2014, 11:37:22 AM by coxy17 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Activate Game Object Using Tag/Global Variable
« Reply #1 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

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate Game Object Using Tag/Global Variable
« Reply #2 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Activate Game Object Using Tag/Global Variable
« Reply #3 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

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Activate Game Object Using Tag/Global Variable
« Reply #4 on: March 06, 2014, 11:37:08 AM »
Hi Jean,

The global variable worked

Thanks

Nick