playMaker

Author Topic: [FIXED] Global variable GameObject reset to null  (Read 3229 times)

ToxicBlob

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
[FIXED] Global variable GameObject reset to null
« on: February 17, 2012, 07:53:35 PM »
My global variable GameObjects are resetting to null between Unity sessions.
« Last Edit: July 02, 2012, 03:47:55 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Global variable GameObject reset to null
« Reply #1 on: February 17, 2012, 07:57:32 PM »
Global variables are a saved asset, like a prefab, so they can't reference scene objects. This is a Unity limitation. Actually the global variable edit field shouldn't let you pick a scene object... I'll look into that...

To be safe I would always use an FSM to initialize global variables when the game starts.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Global variable GameObject reset to null
« Reply #2 on: May 09, 2012, 09:44:51 AM »
Global variables should keep their default values now in 1.3.3.

They still, however, can't reference scene objects.