I'm having trouble understanding why "Trigger Once" is not working as expected in this context (see attachment). I'm not looking for workarounds, I'm simply trying to understand why it's doing this.
The Code
I have an object "Sprite" with a variable called "Color". Every second I destroy all existing "Sprite" objects and then create two new ones - one with Color explicitly set to 0, and the other with Color set to 1. After that, based on the value of Color, I set the animation of each "Sprite" object to either "Color0" or "Color1".
Expected Behavior
Every second, I would expect to see one yellow "Sprite" and one blue "Sprite". This is because the "Color = 1" condition for the newly created sprite has never run in the previous tick. It may have run for a previous object, but not for the newly created one.
Actual Behavior
After the first round of creation, both sprites end up being yellow. This is presumably because "Trigger Once' doesn't care about which object it is firing for, it merely checks to see if the same event happened in a previous tick. But I could be missing something.
Exactly what's going on here? Can someone break it down for me?
Thanks!