I've seen another thread about this but still. can't get the variable value correctly
PlayMakerFSM[] temp = Player[0].GetComponents<PlayMakerFSM>();
foreach (PlayMakerFSM fsm in temp)
{
if (fsm.FsmName == "Hit")
{
Debug.Log("get Hit fsm");
P1fsm = fsm;
break;
}
}
p1_health = P1fsm.FsmVariables.GetFsmFloat("HP").Value;
Debug.Log(P1fsm.FsmVariables.GetFsmFloat("HP"));
I always get "0" value. it should be 1000 if the code was right.
[EDIT]
solved. my bad.
this script runs before the value initialize.