I got a little further. I've managed to create an array and swap the material of the objects inside of it. But something weird happens. When I add another state with an Get Key Down action it error's. When I remove it, it works...
This is how I put it together so far:
Start state: Array List Find Objects By Tag + Array List Add (Game object: use owner + reference)
2nd State: Array List Get Next (Game object: use owner + reference + loop event (go to 3rd state) + finished event (go to 4th state)
3rd State: Set Material + Send Event (to loop to the 2nd State till all objects have been swapped)
4th State: no actions yet, but it's some sort of finished state I don't know yet what to do with it, but I use it to see if the FSM finishes the loop...
With these 4 states it works. But when I create new start State with a Get Key Down action it errors. It does swap all the materials, but it won't trigger the 'finished event' in the state with the Array List Get Next action. I get this error:
the fsmVar value <UnityEngine.Gameobject> doesn't match the value <System.Single>
Well this is some real abracadabra to me. It would be really nice if someone could help me out.
Thanks in advance!