Hey there,
i after many thoughts i looked into the ArrayMaker in order to make a better approach to the Inventory-System in my Game. I tried something out, which worked fine, but now i have a serious problem. At a certain point something within the FSM crashes Unity, which is very very annoying.
So, first, my Setup:
I have this 2x2 Grid Spriteobject:
In the Center of each Gridfields, there are empty GameObjects called SLOT1-4.
Each SLOT-Object has an PlayMaker ArrayList-Proxy attached.
The Prefill Type is "String".
What do i want to do? It's quite simple. Every time the Player want's to pick up an Item (these Spriteobjects have an BoxCollider attached, as a Trigger!), it will send an Event to the First Slot:
The SLOT-FSM looks like this:
So, the very first thing i do is asking if the ArrayList already contains an Item:
If it has no Item in the List, i move on to the next State Adding the Item to the List:
Then in the next State i create the Object out of the Prefab:
Setting the SLOT1 as a Parent and make the Object PixelPerfect.
If it HAS AN Item in the List, i send an Event called "SLOT2" to the second Slot. There, it's basically the same procedure. I ask if the List contains already an Item, if not, i add it, create the item etc., if yes, i send an even to the next Slot and so on.
If you look at this picture again:
If I make a Transition "FINISHED" at State6 and direct it to the "ITEMTRIGGER"-State, the Game breaks when the Character moves into a TriggerCollider and Unity Crashes.
If i don't do that, it works till i pick up the second Item (Remember, every Item sends an "ITEMTRIGGER"-Event to the first Slot).
I was sitting the whole night at this problem and can't think clearly anymore, i would really appreaciate some help on this. So, thanks in advance!