Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: rudine on April 08, 2017, 11:16:00 AM
-
Any way to load playmaker template by script ?
-
Hi,
I tried myself but it's not really supported and gives some problems down the line, it's unfortunate...
you can try however: RunTemplateFSM on the Ecosystem
(http://i.imgur.com/SLTpOyu.png) But watch out for potential issues.
Bye,
Jean
-
hmm what i need is the RunFSMTemplate method but getting the template from its name.
I found another solution to it,
var template = Resources.Load(name.Value) as FsmTemplate;
var asd = new GameObject(name.Value);
var comp = asd.AddComponent<PlayMakerFSM>();
comp.SetFsmTemplate(template);
comp.Fsm.Start();
-
Hi,
yep, good idea. Be careful with performances, adding PlayMaker component at runtime is costly.
Bye,
Jean