Hi Alex, here is the scene I reproduced. There are 3 cubes (Player1, Player2, Player3) and a GameManager.
The GameManager has 2 FSM, FSM_Works and FSM_DoesNotWork. Run each separately for 2 different results.
Basically both FSMs are trying to do the same thing. FSM is not a loop but hard codes each player_in_turn. FSM_DoesNotWork finds the Player & loops until we iterate all 3 Players. Maybe the Find GameObject action is the one with the caching bug.
Now inside each cube Player there is a simple properties script with some variables. I just picked one which is current_army_value. What both FSMs try to do is get the component script, access the property (int) and then add it to itself, before setting the property with the new doubled value. Then we move on to the next player.
I have initialised the values of current_army_value for Player1 to be 1, Player2 to be 2, Player3 to be 3. Therefore, the current_army_value after the FSM finishes should be 2, 4, 6 respectively. FSM_Works produces this result but for FSM_DoesNotWork, it gives, 8, 2, 3. This is due to the fact that it accesses Player1's 1, doubles it to 2. Then it accesses it a 2nd time, doubles it to 4, and then a 3rd time and doubles it to 8. Both Get and Set Property constantly go for Player1. However, like we mentioned before, the Debug GameObject and Debug Object actions show that player_in_turn and the player_properties variables point to the Player1, then Player2, then Player3 and not just Player1.
Hopefully you can get back to us soon.. I really need this to work properly