So for some reason, I'm really struggling with state machines in C3, specifically relating to when there are more than one instance working in a layout. I have a typical example below which, to my eyes, should work.
Basically, each enemy has an 'enemyState' variable (which is assigned at the family level). This particular enemy is idle until having LoS to player, at which point they move to 1. During state 1, enemy flies around and starts counting down to release a burst attack. Once the burst attack is over, enemy goes back to state 1 and flies around a bit more.
Should work fine. And it does, until a second bat instance enters state 1. At this point, the bats will move between states but not run any lines that are inside the 'trigger once' blocks. In the past, I had my set animation lines in there until realising that they weren't being activated unless I moved them out.
Logically, I can't see why this works when there is one instance in play, but breaks as soon as a second one enters. Surely the condition is selecting the correct instance that is triggering the state machine? I thought that maybe I needed a 'for each' block in there, but that made no difference whatsoever, whether I put the 'for' block in each state condition, or make one parent 'for' block and have all the state conditions to be sub-events of it, makes no difference.
So either I'm missing something very obvious or I don't know what. But I'd love a bit of help on this one just to stop me making similar mistakes in the future.
Cheers