playMaker

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

ToxicBlob

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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3985
  • Official Playmaker Support
    • LinkedIn
Re: Global variable GameObject reset to null
« Reply #1 on: February 17, 2012, 09: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: 3985
  • Official Playmaker Support
    • LinkedIn
Re: Global variable GameObject reset to null
« Reply #2 on: May 09, 2012, 12:44:51 PM »
Global variables should keep their default values now in 1.3.3.

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