playMaker

Author Topic: Global Variable values being overwritten at runtime [SOLVED]  (Read 1961 times)

Spunkyinteractive

  • Playmaker Newbie
  • *
  • Posts: 22
Global Variable values being overwritten at runtime [SOLVED]
« on: September 11, 2016, 11:40:43 PM »
As the title states, I've been having a problem with global variable values being overwritten when I run the game in the editor. So after I exit 'play mode' I can see that various global variables are now showing new values even though nothing has been saved to playerprefs.

This has forced me to add a bunch of logic for resetting all global variables of my project at runtime which I'd rather not have to implement if possible.

I'm wondering is this a bug or is it intentional that global variables can be permanently overwritten during runtime. If so I'd love to understand why its designed that way.

-Stephen
« Last Edit: September 12, 2016, 02:18:47 PM by Alex Chouls »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Global Variable values being overwritten at runtime
« Reply #1 on: September 12, 2016, 07:31:02 AM »
Hi,
What version of playmaker and unity are you using?
i had this problem on an older version from playmaker.

Are the global variables visible when you play?
If so can you try if they are not visible if they are still changed when you play.

Spunkyinteractive

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Global Variable values being overwritten at runtime
« Reply #2 on: September 12, 2016, 12:05:12 PM »
Hi, thank you for the reply.
I just updated to 1.8.3 and no more global var issues!
It seems as you said, this was an issue with older versions of playmaker.

I'm not sure what you mean by global variables that are 'visible' when i play.

Thanks for the help in uncovering why i was having this issues. In the future, i'll make sure to check and make sure i'm on the latest before posting ;)
-Stephen