playMaker

Author Topic: Check array for any objects with a specific tag?  (Read 1064 times)

OnyxRook

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Check array for any objects with a specific tag?
« on: June 04, 2014, 04:35:55 PM »
I feel like there's definitely a way to do this, and I'm just not finding it!

I'm using the custom overlap sphere action that someone kindly contributed to the forum to build an array of objects within range of my subject. I want to check that array to see if anything contained within it has a specific tag, and send an event.

The only ArrayMaker action I've found that utilizes tags just builds an array based on them.

Am I overlooking an specific action, or can someone suggest a way to get the results I'm looking for?

Thanks!! ;D

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: Check array for any objects with a specific tag?
« Reply #1 on: June 05, 2014, 07:35:47 AM »
Try 'Array list find game objects by tag' I used the same sphere and this action to get the desired result.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

OnyxRook

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Check array for any objects with a specific tag?
« Reply #2 on: June 05, 2014, 04:03:44 PM »
Hi sebaslive!

Thanks for the reply, but I'm not sure I'm seeing how array list find game objects by tag works in this situation. That action just creates an array of objects with the defined tag regardless of where they are in the scene, and I think referencing the array pre-built with the overlap sphere simply overwrites it, doesn't it?


OnyxRook

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Check array for any objects with a specific tag?
« Reply #3 on: June 05, 2014, 04:11:57 PM »
Actually, to further define what I need, I'm essentially looking for an action that's exactly like 'Array List Contains', but with the option to look for a tag! :)

sebaslive

  • Hero Member
  • *****
  • Posts: 539
    • View Profile
    • Frame Tale Studios
Re: Check array for any objects with a specific tag?
« Reply #4 on: June 05, 2014, 07:48:32 PM »
Oh okay, well, its not an array action but you could use 'game object compare tag' and run a loop that if it finds it, it does its action, like do damage and then remove that object from the list, get next random object in the array, run the 'game object compare tag' again and etc.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13512
  • Official Playmaker Support
    • View Profile
Re: Check array for any objects with a specific tag?
« Reply #5 on: June 06, 2014, 03:56:04 AM »
hi,

 I'll work on that. Currently, you simply need to iterate trhough each gameobject in your array and compare it's tag. But an action would be convenient I agree.

task added to trello for this

 Bye,

 Jean

mickman

  • Junior Playmaker
  • **
  • Posts: 60
    • View Profile
Re: Check array for any objects with a specific tag?
« Reply #6 on: November 08, 2018, 01:00:55 AM »
Hi Jeanfabre...  Was this  Check TAG  Action ever created ??   

An action that checks the Tags of multiple game objects  that  enter into an area of a game object ?   ( not just a single game object ).

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 828
    • View Profile
    • Fat Pug Studio
Re: Check array for any objects with a specific tag?
« Reply #7 on: November 08, 2018, 03:24:55 AM »
I don't think so, why can't you just add all the objects that entered the area to array and iterate? It's simple and fast.