playMaker

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

dasbin

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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3476
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: How to access FsmGameObject in a script?
« Reply #1 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...