playMaker

Author Topic: ArrayMaker - Get all gameobjects with Tag[SOLVED]  (Read 3188 times)

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
ArrayMaker - Get all gameobjects with Tag[SOLVED]
« on: February 02, 2013, 03:29:16 AM »
Hi,

I'm not sure if this has been created (I've looked and all I can find is get closest gameobject) but what I'm after is an action that will get all the gameobjects in a scene and create an array out of them. Basically when my level loads it will create an array of all the spawn points, as each level could have a different amout it would be great to do this on load and not manually add them each level.

Cheers
Andrew
« Last Edit: February 07, 2013, 02:51:30 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: ArrayMaker - Get all gameobjects with Tag
« Reply #1 on: February 02, 2013, 03:17:48 PM »
Hi,

 I would take the opposite approach. Every object that wants to register itself as a spawning point should add itself to that array, then you avoid complex and resource intensive search in your scene.

 Does that make sense?

bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: ArrayMaker - Get all gameobjects with Tag
« Reply #2 on: February 02, 2013, 08:52:43 PM »
Thanks Jean,

Now that you have pointed it out it seems very obvious, thanks again for your help.