Playmaker Forum

Playmaker Help & Tips => Playmaker Help => Topic started by: OnyxRook on June 04, 2014, 04:35:55 PM

Title: Check array for any objects with a specific tag?
Post by: OnyxRook 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
Title: Re: Check array for any objects with a specific tag?
Post by: sebaslive 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.
Title: Re: Check array for any objects with a specific tag?
Post by: OnyxRook 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?

Title: Re: Check array for any objects with a specific tag?
Post by: OnyxRook 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! :)
Title: Re: Check array for any objects with a specific tag?
Post by: sebaslive 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.
Title: Re: Check array for any objects with a specific tag?
Post by: jeanfabre 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
Title: Re: Check array for any objects with a specific tag?
Post by: mickman 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 ).
Title: Re: Check array for any objects with a specific tag?
Post by: krmko 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.