Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: MGuy on March 02, 2012, 03:30:41 AM
-
How do I set/get a global variable from my script?
Thanks.
-
A quick example:
var globalVariables = FsmVariables.GlobalVariables;
var numLives = globalVariables.GetFsmInt("numLives");
numLives.Value = 3;
-
Is FsmVariables a static object? I can't seem to access this object from my c# script.
-
Sorry, add this:
using HutongGames.PlayMaker;
-
Sorry, add this:
using HutongGames.PlayMaker;
Thanks. :)
-
How do I do this in JavaScript?
-
hi,
It's very similar:
#pragma strict
import HutongGames.PlayMaker;
function Start () {
var globalVariables = FsmVariables.GlobalVariables;
var numLives = globalVariables.GetFsmInt("numLives");
numLives.Value = 3;
}