Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on August 15, 2015, 05:56:36 PM
-
Hi!
I have an Arraylist with 4 differents objects. They have the colors Blue, Green, Red and Yellow. What I want to do, is to duplicate each of this 4 objects, so it will be two of each object in the scene when I create them. Like in a memory game. When you need to find two matching objects.
Is it a way to do this?
-
Hi,
There is no built in Actions to duplicate contents in the Scene.
As is, simply iterate trhough the list using "ArrayListGetNext" and use the action "CreateObject" Action using the current item in the loop as the source for the object creation. Usually you would reference a Prefab, but in this case it works too.
Bye,
Jean
-
Hi, Jean!
Thanks for the answer.
If I loop the ArrayListGetNext, it just add the next item in the list
I tried with ArrayListGet and always use index 0. Then I remove the item in the list every time I loop it, so it will add each item twice, but I got some few problems.
-
you can also reset using array list get next by setting the reset to true, that way it will start at 0 again.
-
I still having problems to duplicate each object. The only thing I want is to create two of each objects in the scene. Like in a memory match game where you need to find two matching objects. I'm very close to make it. It's just few problems.
Array List Get will always be at index 0, but this has no LOOP.
-
I got it to work! :)
Now I only nee to make the logic. To open the cards and close it when it doesn't match and so on. :)
-
Hi,
Excellent! Never giving up is key!
Bye,
Jean
-
Stubborn is my middle name! :)
-
Just one thing, Jean!
Do you know when Arraymaker will be updated? I can't use Array List Add Range. I get an error. So I need to add them in the Inspector window "Prefilled Data"
-
Hi,
can you refresh my memory on this issue? Is there a thread o nthis already?
Bye,
Jean
-
Hey Jean, its an error with the current arraymaker. The Array List Add Range action is currently not working as expected. It does not show the variables in the array.
-
Hi,
Using the PlayMaker Beta or current Asset Store version?
Bye,
Jean
-
Current asset store version.
-
Hi,
can you refresh my memory on this issue? Is there a thread o nthis already?
When I add "Array List Add Range" in a FSM, It does not show the variables in the array as sebaslive said, but also when I use "Array List Get Next", I get this error:
The fsmVar value <UnityEngine.GameObject> doesn't match the value <HutongGames.PlayMaker.FsmVar> on stateState 2 on fsm:FSM on GameObject:GameObject.
If I add the variables in the Array List Proxy in the Inspector window, then everything works find. At least I don't get this error.
-
Hi,
oh, yes, I can repro this, I get it now. Let me see what's wrong, I'll get back to you when this is fixed I am travelling until monday, so don't worry if I don't get back to you before.
Bye,
Jean
-
Hi,
ok, found the issue, I corrected the Action ArrayListAddRange, now everything should behave properly including accessing these newly added data ( data was corrupted).
Bye,
Jean
-
Thank you Jean! Will it be available on the Ecosystem soon? :)
-
Hi,
It is already (https://twitter.com/JeanAtPlayMaker/status/634181594903785472) :)
Bye,
Jean
-
Ah, so nice! :) Thank you! But do I need to update Ecosystem? Because it says there that it's already imported.
-
Hi,
you can press the delete button and then you can import it again
-
Hi!
Yes, I know, but I'm so afraid if I should mess up something, but I can take a backup of the project first. It's time to do that anyway. :)
-
Hi,
yes alway make a backup :)
i do that almost everyday,
i make a folder with a date on it and some extra info if i changed something major
and save the project folder there.
and @ the end of the month, delete those that i am sure of that i dont need anymore.
-
That's very good to do. :) I don't do it that often.
Time to backup! :)
-
Hi,
When you want to update an item already downloaded, simply "delete" it from the Ecosystem, and then you can download it again. I need to add a button "update" just to make things less scary... :)
Bye,
Jean