playMaker

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

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
[SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« on: December 06, 2017, 04: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, 09:40:11 PM by craigz »

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #1 on: December 06, 2017, 09: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: 15500
  • Official Playmaker Support
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #2 on: December 08, 2017, 02: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: 234
    • Haven Made
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #3 on: December 09, 2017, 09: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: 15500
  • Official Playmaker Support
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #4 on: December 14, 2017, 01:50:09 AM »
Hi,

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

 Bye,

 Jean

autumnboy

  • Junior Playmaker
  • **
  • Posts: 73
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #5 on: August 05, 2019, 01:11:41 AM »
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: 23
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #6 on: October 11, 2019, 12:05:29 AM »
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
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #7 on: December 06, 2019, 07: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.

Fat Pug Studio

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

zirai

  • Playmaker Newbie
  • *
  • Posts: 28
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #9 on: April 24, 2020, 09: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, 09:37:02 AM by zirai »

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 40
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #10 on: May 24, 2020, 01:42:33 PM »
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, 03:53:50 PM by mmzbr »

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #11 on: November 12, 2020, 12:35:13 AM »
Just happened to me with Unity 2019.4.8 and Playmaker 1.9.0. I was editing a prefab changing a 'Send Event' from GameObject FSM to just GameObject and the linked global variable (gameManager) just completely disappeared from my project.

I was able to go back to an older version of the project thanks to versioning. But wow, that's crazy that something like this even can happen!!!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #12 on: November 12, 2020, 05:11:06 AM »
Hi.
It seems to happen when using undo while on a prefab with a global involved.

if it happens its best to restart unity, most of the times it seems to be back after doing that.

But more important, use Version control like github.
You can revert change on single files like the global
you can try something out and if it does not work you can just revert.

Also it backups only your changes so its way faster than making a backup of your project.

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #13 on: November 12, 2020, 11:50:44 AM »
hmmm I'm using versioning but since playmaker works on a scene level it most of the time is just the scene that I commit. How can you get on a detailed level like revert only the global?

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 770
Re: [SOLVED] Corrupt Global Variables - Disappearing/Unlinking
« Reply #14 on: November 12, 2020, 12:57:38 PM »
hmmm I'm using versioning but since playmaker works on a scene level it most of the time is just the scene that I commit. How can you get on a detailed level like revert only the global?

The Globals are saved in a separate asset file in the Playmaker folder. Perhaps you should add this file to the versioning supervision too?