Hello,
I am posting this here and not the bug report because I am not sure if I'm not doing something wrong.
In short: Create Object 1, and use FSetFsmVariable. When creating a new Object 2 and using FSetFsmVariable for the same variable, PlayMaker uses the caches variable that is still pointing to Object 1.
My scenario:
GameObject A, with multiple FSMs.
FSM1 receives event and transits to a new state "Create Object".
In that state, it creates an object OBR using a prefab, stores the reference to it in a variable. Still in that state, it uses FSetFsmVariable to set var RACKID and sends an event to the created object to go to initialize state.
So far so good, FSM1 completes the state and returns to state READY, and created object PBR also finishes its initialized state and goes to READY state.
GameObject A, FSM1, receives the same event again, transits to new state, creates a new object again. The object has the same name, but the reference/variable to the object is correctly updated and calls FSetFsmVariable to set var RACKID, and here is where things get wrong.
Debugging public class SetFsmVariable: FsmStateAction, it checks for a cached object, it correctly detects the new object is not cached and gets the correct reference.
Then it checks for cached var RACKID, and it INCORRECTLY thinks it has the cached variable and uses the old reference! In other words, it updates (again) RACKID variable on the first created object.
By commenting out the below lines, it now correctly updates the variables on the second object.
//if (variableName.Value != cachedVariableName)
//{
targetVariable = targetFsm.FsmVariables.FindVariable(setValue.Type, variableName.Value);
cachedVariableName = variableName.Value;
//}
I did not dive into the code enough, but I would guess that if the cached object is changed, then checking for a cached variable should be skipped.