playMaker

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

escpodgames

  • Hero Member
  • *****
  • Posts: 677
    • View Profile
    • Assets
ArrayMaker - Get all gameobjects with Tag[SOLVED]
« on: February 02, 2013, 01: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, 12:51:30 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13432
  • Official Playmaker Support
    • View Profile
Re: ArrayMaker - Get all gameobjects with Tag
« Reply #1 on: February 02, 2013, 01: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: 677
    • View Profile
    • Assets
Re: ArrayMaker - Get all gameobjects with Tag
« Reply #2 on: February 02, 2013, 06:52:43 PM »
Thanks Jean,

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