Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on August 14, 2015, 07:23:50 AM

Title: Arraymaker and Send Event[SOLVED]
Post by: Rabagast on August 14, 2015, 07:23:50 AM
Hi!

I have a problem with Arraymaker when I'm going to send an event.
Well, this is not an Arraymaker problem.
Let me explain:

I have 10 prefabs I put in an Array List. Then I use the action Array List Get Random. Then I create an object. I loop this until all the 10 objects are placed in the scene. So far is ok. The problem is that I need to send an event to these objects in the scene I created from prefabs. It doesn't work, because it send the event to the prefabs objects. Not to the scene objects. Is this impossible to do? Or is it a way to solve this?

Hope someone can help me. :)
Title: Re: Arraymaker and Send Event
Post by: terri on August 14, 2015, 08:38:01 AM
I'd create a new array list and add the instances to it as they are spawned, and then you can send them the events.
Title: Re: Arraymaker and Send Event
Post by: Rabagast on August 14, 2015, 08:50:37 AM
Hi!
How do I add instances to the objects? Maybe I didn't understand. Sorry for that!
Do you think you can explain a bit more?
Title: Re: Arraymaker and Send Event
Post by: terri on August 14, 2015, 08:55:07 AM
by instance I mean the "scene object" instead of prefab.
you're already doing it! just add them to a new array right after you create them
Title: Re: Arraymaker and Send Event
Post by: Rabagast on August 14, 2015, 09:31:05 AM
Ok, thanks!

I will try that. Or else I can just add the prefabs manually to the scene and use the scene objects in the Array List. It worked.
Title: Re: Arraymaker and Send Event
Post by: Rabagast on August 14, 2015, 10:11:33 AM
It works. I just added the created object to a new Array List. Then I could send an event to that object. :)
Title: Re: Arraymaker and Send Event
Post by: dudebxl on August 14, 2015, 10:55:38 AM
You can also send event by tag.. set your gameobject tags then send the event

The action can be found on the ecosystem..
Title: Re: Arraymaker and Send Event
Post by: Rabagast on August 15, 2015, 05:44:37 PM
Quote
You can also send event by tag.. set your gameobject tags then send the event

I made it without using this, but I found it very useful, so probably I will use it later. Thanks for this. :)