playMaker

Author Topic: [Set FSM Variable] - Not setting them after first time  (Read 1873 times)

KirbyRawr

  • Playmaker Newbie
  • *
  • Posts: 16
    • Overflowing Team
[Set FSM Variable] - Not setting them after first time
« on: July 05, 2016, 06:26:05 AM »
Hi there, there is a bug in SetFSMVariable action.

Steps to reproduce

Setup- Create a Empty GameObject with a FSM attached to it and set 2 variables of type string.
1- Instantiate the prefab we created, from a FSM.
2- From the FSM we instantiated the prefab, use the SetFSMVariables action for set the prefab FSM variables with the string data you want.
3- Destroy the prefab and try to use the same FSM for repeat the process.

Results:
The SetFSMVariables will work only one time since it have it cached.

Solution:
In the SetFSMVariables action, put this before the finish:
Code: [Select]
cachedGameObject = null;
cachedVariableName = null;
cachedFsmName = null;

Cheers!