playMaker

Author Topic: How to access FsmGameObject in a script? [SOLVED]  (Read 3225 times)

dasbin

  • Junior Playmaker
  • **
  • Posts: 92
How to access FsmGameObject in a script? [SOLVED]
« on: February 06, 2012, 04: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?
« Last Edit: February 29, 2012, 01:35:49 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: How to access FsmGameObject in a script?
« Reply #1 on: February 06, 2012, 10: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...