Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: dasbin on February 06, 2012, 02:04:53 PM

Title: How to access FsmGameObject in a script? [SOLVED]
Post by: dasbin on February 06, 2012, 02:04:53 PM
This is using Javascript.

Trying to get a FsmGameObject (global var) from PlayMaker and store it into a GameObject var in my script.

Right now I have:
Code: [Select]
grabZone = grabFSM.FsmVariables.GlobalVariables.GetFsmGameObject("currentGrabZone");
This gives me the error:
Quote
BCE0022: Cannot convert 'HutongGames.PlayMaker.FsmGameObject' to 'UnityEngine.GameObject'.


How do I convert to a usable GameObject?
Title: Re: How to access FsmGameObject in a script?
Post by: Alex Chouls on February 06, 2012, 08:56:16 PM
Get the Value property.

Code: [Select]
grabZone = grabFSM.FsmVariables.GlobalVariables.GetFsmGameObject("currentGrabZone").Value;
But you probably want to check for null first...