Hi, i'm trying to copy variables from an array in a script into an FSM's array variable. Although it kinda works there seems to be some issues with it updating reliably... After reading another post I tried adding the line:
managerPlayMakerFSM.FsmVariables.GetFsmArray("achievementStatus").SaveChanges;
However in Visual Studio this gives me the error:
Error CS0201 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
Here is the full code:
public void CheckAllAchievementStatus()
{
//loop through the array 'unlocked' and set each bool entry to the result from the steam query and total them up in a lovely int
totalUnlocked = 0;
managerPlayMakerFSM.FsmVariables.GetFsmBool("checkComplete").Value = false;
for (int i = 0; i < unlocked.Length; i++)
{
unlocked[i] = ach[i].IsAchieved;
achievementStatusFsmArray.boolValues = unlocked;
if (unlocked[i])
{
totalUnlocked++;
}
}
//copy the array to the PlaymakerFSM array
achievementStatusFsmArray.boolValues = unlocked;
managerPlayMakerFSM.FsmVariables.GetFsmArray("achievementStatus").SaveChanges;
managerPlayMakerFSM.FsmVariables.GetFsmInt("achievementsUnlocked").Value = totalUnlocked;
managerPlayMakerFSM.FsmVariables.GetFsmBool("checkComplete").Value = true;