playMaker

Author Topic: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking  (Read 3451 times)

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 209
    • View Profile
    • Haven Made
[SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« on: December 06, 2017, 02:04:01 PM »
Hi!

I keep having Global Variables deleting themselves and breaking their connections to FSM's. It's been getting super frustrating and I'm not sure what to do. Each time it happens I lose hours of work  :-\

Without really knowing how things are working, my only guess is that my Gameobject Global Variables section is corrupt somehow?

The variables that get disconnected don't show up in my Global Variables inspector preview OR the window. But they DO show up in the actual file If I crack it open.

Things to note:
1. First time this happened was with the 'game_game_manager' variable, which I now realize I have two of in my globals for some reason?



2. The variable I'm currently missing is 'game_unit_manager' which shows up in the actual globals file still, but not in the globals inspector preview or the playmaker globals window.





3. In the inspector preview of the globals, there's a floating/unassigned game object variable at the top, seems out of place, could possibly be contributing to the error?




I would just really appreciate some help with this. Been beyond frustrating ><

-craigz
« Last Edit: December 06, 2017, 07:40:11 PM by craigz »

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 209
    • View Profile
    • Haven Made
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #1 on: December 06, 2017, 07:39:22 PM »
Alrighty :) spent a day figuring this one out.

At some point within the past 3 or 4 versions of Playmaker I believe my global variables got corrupted. I specifically remember it happening around the time categories became a thing.

The issue was that when making a new global variable, it would delete one that was made prior, unlinking it from anything that was referencing it.

Here's what I did to fix it:

1. Open up your PlayMakerGlobals.asset file in mono.

2. Go to the variable header of the type of variable that was deleted. For instance, mine was a gameobject, so I scrolled to here ->



3. Go through line by line and see if you have any duplicate variables. It would look something like this ->



4. Delete BOTH variables sections. I've highlighted what it should look like in red.



5. Save the file. Exit out of the Global Variables window if you have that open. Then close Unity.

6. Open Unity again, open the PlayMakerGlobals.asset file again and do a ctrl+f to search for the variable to make sure it's not in there.

7. Open your globals variables window, create the variable again.

8. Go through your Error Check window and go ahead and put in that new variable you created.

***If your variables keep appearing in the PlayMakerGlobals asset file even after you delete them, delete them again, and delete all your categories from the file. Just scroll down til you find the area between Global Variables and Events. Or do a quick search ctrl+f for 'category'. Delete all the dashed categories and the category ID's (but be sure to leave a single dash under categories). Make it look like this ->




After that, close Unity, open it back up and you should be all good to go!

I hope no one else has to put up with this problem. Cheers to a bug-free PlayMaker 2.0!

-craigz

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15373
  • Official Playmaker Support
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #2 on: December 08, 2017, 12:09:40 AM »
Hi,

 thanks for this. I pinged Alex on this, maybe there is something we can do internally to check for these duplicates and correct it. We'll see.

Bye,

 Jean

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 209
    • View Profile
    • Haven Made
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #3 on: December 09, 2017, 07:25:02 PM »
Excellent, great to hear Jean, thank you :)

Wish I had an exact version for when I think the problem originated for you guys, hopefully it was just a legacy issue for me. Saw a couple other people on the forum with it so just wanted to make sure the information was on the internet somewhere ;)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15373
  • Official Playmaker Support
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #4 on: December 13, 2017, 11:50:09 PM »
Hi,

 yes, that's the spirit, thanks for contributing in the knowledge, it means a lot to us :)

 Bye,

 Jean

autumnboy

  • Junior Playmaker
  • **
  • Posts: 70
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #5 on: August 04, 2019, 10:11:41 PM »
I had a problem where pasting values on top of an existing fsm via the inspector caused a global variable to take on the same name as another. This post helped me fix it and save a lot of hassle!

- I closed Unity.
- Opened the PlayMakerGlobals.asset file, fixed the name, saved it.
- Reopened Unity and it was fine.

Thanks,
Josh

Wrensey

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #6 on: October 10, 2019, 09:05:29 PM »
I just wanted to report in with saying that this still happens. The fix craigz posted seems to work for permanently deleting the corrupted variable, but it is still a massive pain to deal with.
Follow me on twitter!

Numster

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #7 on: December 06, 2019, 05:16:20 AM »
Hi !

Yep, this still happens... And I don't know how to open the .asset "in mono". Don't even understand what "in mono" is saying.

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 1063
    • View Profile
    • Fat Pug Studio
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #8 on: December 09, 2019, 01:41:16 PM »
Just open it in any text editor.

zirai

  • Playmaker Newbie
  • *
  • Posts: 28
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #9 on: April 24, 2020, 06:28:59 AM »
Hi, still got this bug today. i use unity 2019.2.19f1
this happened after i copy paste fsm states (with global variable) into my prefabs.
Suddenly my i got duplicates global.

So i opened the global.asset and just rename one of the duplicates with _err

and i got bunch of zeros after variableCategoryIDs:  and delete it, restart unity
and delete the duplicate global with _err and it's problem solved.

one more thing, when this bug happened,i open and edit some of my prefabs and the global become corrupted. so yeah,don't do it :D
« Last Edit: April 24, 2020, 06:37:02 AM by zirai »

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #10 on: May 24, 2020, 10:42:33 AM »
Using Unity 2018.4.17f1 and got this corrupted global variable bug.

One of mine Globals vanished from Resources.asset, had to re-create but Playmaker re-linked automatic all FSM.
« Last Edit: May 24, 2020, 12:53:50 PM by mmzbr »