I have created a FSM to copy the children of an object into an array. I am using the GetNextChild Function to process through the list. At first, I thought it was the GetNextChild Function but to problem solve I put a pause state in to see if the system was getting the object value.
So my logic is
State: Cards Selected
Action: GetNextChild (set CurrentCard to Current Child)
Transition: LoopSelCards --> State: State 1 (Event for each card)
Transition: Children Stored --> State: Change Scene (Event for All Children processed)
State: State 1 (temporary wait)
Action: Wait (5 seconds)
Transition: Finished --> State: Process Child
State: Process Child
Action: ArrayAdd (CurrentCard)
Transition: Finished --> State: Cards Selected
State: Change Scene (will eventually change scene, but currently just a dialog)
Action: SendMessage (used to call my dialog that I create)
Transition: none.
This logic seems to work well except the last child (card) does not get put in the array. Because of the pause at "State 1" I can clearly see the proper child is in the CurrentCard variable, but the ArrayAdd doesn't seem to put it in the array.
I can't figure out why.