playMaker

Author Topic: activate game obj. by tag  (Read 1963 times)

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
activate game obj. by tag
« on: December 03, 2013, 02:44:01 AM »
I think this would be useful.  :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: activate game obj. by tag
« Reply #1 on: December 03, 2013, 05:32:38 AM »
Whats your use case? Are you trying to activate a bunch of objects with a specific tag or activate an object only if it has a specific tag?

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: activate game obj. by tag
« Reply #2 on: December 13, 2013, 02:17:19 PM »
Hi, I'm trying to deactivate all weapons when a character selects a new weapon. I suppose I could child them all to an empty game object and then deactivate that?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14593
  • Official Playmaker Support
    • View Profile
Re: activate game obj. by tag
« Reply #3 on: December 14, 2013, 11:14:09 AM »
Hi,

 not really nice. I would implement a global event system that you would broadcast to all.

 you would first fire a "DISABLE WEAPON", and then enable the one the user selected. that will be easier.

 if you want to go crazy :) actually create a global event "SELECT WEAPON", and pass the weapon reference with that event, then ALL weapons responds to it, and double check that the passed references matches or not, and they disable themselves if not matching, else it's the selected one and it can proceed and do what ever it needs to become the selected weapon.

bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: activate game obj. by tag
« Reply #4 on: January 14, 2014, 01:53:33 PM »
Jean, I always want to go crazy so I'll probably try it that way, thanks!