Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Anykey on April 12, 2012, 10:22:30 AM
-
Hi :)
I'd like to know how I could disable or enable a FSM of all the gameObjects of an Array list in arrayMaker
thanks ;)
-
Hello,
Playmaker has an action for this: https://hutonggames.fogbugz.com/default.asp?W55 (https://hutonggames.fogbugz.com/default.asp?W55)
Now, to go through each gameObject from an array, you can use the following package and study the distanceSorting scene.
basically, you create an int variable to you increment and use it to get the element of an array, you work with it, then back to your incrementing state and so on until the int is out of bounds.
If you have problems understand this, let me know and I'll do a working example using your case.
Bye,
Jean
-
Thanks Jean , I've understood your explaination but actually , I finally found an easier way to do it
-
Care to share? :)
-
Actually , I wanted to list all the ennemies spawned and disable all their FSM to "freeze" them while I'm in the shop.
But finally , I chose to make a global bool which is put to true when I open the shop , all the ennemies have a FSM which says that when the bool is true , disable the "Move&Attack" FSM
the way I wanted to do with the list was definitely not of a good use , but eh ! I'm just a programming beginner :)
-
Hi,
You could also create two global events "FREEZE", and "UNFREEZE", and implement that in your enemies, and fire them as you go in and out of your shop. Then they don't need to spy on that bool all the time ( tho, I do it sometimes too, so nothing dramatic).
Bye,
Jean