Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: dasbin on May 09, 2013, 03:50:03 PM

Title: Playmaker is changing the name of a global variable
Post by: dasbin on May 09, 2013, 03:50:03 PM
Really weird bug here.

Occasionally, after pressing play, Playmaker will actually change the name of a particular global variable (playerGO) to an incorrect one (hitObject). hitObject is the name of a local variable I use in one particular game object to store a collision. I can't see any particular relation between this variable and my playerGO.

Anyway, somehow this change persists after stopping, and most of my prefabs somehow update themselves to reference this new, incorrect variable name. However, some don't, and they reference null.

I've corrected its name in the global variables list a few times, but it keeps changing back on its own.
Title: Re: Playmaker is changing the name of a global variable
Post by: AtomicJoe on June 04, 2013, 12:05:49 PM
I'm having the same issue here with 2 GameObjects variables.
The weird thing is, I finally gave up and created new variables to change them, since they keept changing, but after changing all the old variable references in all the FSMs and deleting the old variables, I'm still having the same issue with the new ones!
This bug is really killing me since I have LOTS of FSMs that reference this two variables (as they are the pointer variables for player 1 and player 2) and every time this happens, some states change thi reference from one variable to the other, others don't and others even lose any reference at all.

This is happening only for global variables when your run the game, but keep changes after you stop!
What makes this a REAL problem is: it persists even if you close unity and reload the project without saving!
Title: Re: Playmaker is changing the name of a global variable
Post by: AtomicJoe on June 05, 2013, 05:15:43 AM
It seems to happen if you:

1- have the playmaker editor open and
2- press apply on a child of a prefab object with a playmaker component
3- press "run game" with the game view not maximized and the playmaker editor open at the same time.

If you press "apply" on the prefab root object instead of the child you just modified it seems to avoid the corruption (my root object doesn't have a playmaker component on it thought. This could be important.).
Also, running the game maximized seems to avoid this behaviour too, however, as it's not always happening in a consistent way, only time will tell.

Just be sure to make backups of the full project folder every day, just in case the playmaker components got corrupted...
Title: Re: Playmaker is changing the name of a global variable
Post by: dasbin on June 05, 2013, 11:53:54 AM
Good sleuthing, I think you are right except for one thing. In my case, I am editing the root of the prefab and pushing Apply on the root - so it still happens there.

I suspect what makes it happen is having an FSM window open at all when you push Apply (as you said, your root object doesn't have an FSM so the editor window wouldn't be showing an FSM when you press apply on the root).
Title: Re: Playmaker is changing the name of a global variable
Post by: AtomicJoe on June 05, 2013, 02:35:43 PM
It just happened again.
I can confirm it happens when pushing the "apply" button to apply the changes of a prefab instance to the prefab object.
However, there was no playmaker fsm showing in the editor, but I had loose the prefab conection due to changing childs inside the prefab. My two variables got messed up again when I hit the "apply" button.

It's important to note the variables got messed up in objects outside of the prefab I was updating too, not only in the prefab.

I just lost 2 hours of programming because of this...  :-\
Title: Re: Playmaker is changing the name of a global variable
Post by: jeanfabre on June 06, 2013, 01:34:37 AM
Hi,

 Have you filed a bug report for this? This will Help tracking this issue.

bye,

 Jean
Title: Re: Playmaker is changing the name of a global variable
Post by: AtomicJoe on June 06, 2013, 05:15:04 AM
Hi,

 Have you filed a bug report for this? This will Help tracking this issue.

bye,

 Jean

Yes, it's the case 730.
By the way, I have noticed the variable change/switch in the actions can happen in less flagrant ways, changing only a few variable references here and there without you noticing it until bugs start to happen. Then you check the FSMs and notice instead of the original variable there is another one assigned or even none!
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 07, 2013, 06:21:16 AM
Related bug here:

I (also) can confirm it happens when pushing the "apply" button to apply the changes of a prefab instance to the prefab object. (It's inconsistent I have not found a distinct way of provoking it, but it surely has something to do with that)

But what I have, is a Global Bool that flips to True! No name changing.
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 07, 2013, 06:40:46 AM
Hmm. This is fishy  :o

I now notice that other global variables start to "keep counting" between game runs - Global variables should not remember state from previous game run, should they?

I have to "admit" that I recently upgraded to PlayMaker 1.6.2.f3 from a slight older version, in the same game.

I'll try and export everything and start over.. (crap - I really hope this does the trick)
Title: Re: Playmaker is changing the name of a global variable
Post by: Horror on July 09, 2013, 12:34:55 AM
Same here! None of my global variables are reverting to their original values after I run and stop the game in the editor. Not good at all.
Title: Re: Playmaker is changing the name of a global variable
Post by: jeanfabre on July 09, 2013, 02:56:46 AM
Hi,

 uhm, I can't repro this. Do you have a repro project I could look at?

bye,

 Jean
Title: Re: Playmaker is changing the name of a global variable
Post by: Horror on July 09, 2013, 09:38:20 AM
Hi Jean, try this:

[ADMIN: Download link removed. Please don't share projects that include the Playmaker dlls]

[HORROR: Removed the file as well!]

On my PC at least, the global variable isn't being reset to 0 after the game has been stopped in the editor.
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 09, 2013, 03:10:20 PM
I When I make changes in prefabs and apply, specially things related to other prefabs are only sometimes applied - and apparently sometimes they are.

When things fail, it acts as if I am making changes of the sort that should not apply to other prefabs (such as rotation as an example) on things that _should_ be applied. Updates are partly working (I hit Apply, and things do change in the other instances), and some things are applied. But not all. And it appears to be linked to prefabs vs prefabs.

I also get annoying error messages of missing links in prefabs - this may be a feature, but it's annoying to have 9 "Setup errors" flashing, when in fact nothing IMO is wrong.

I have reported this as a bug as well, I am just stuck with this issue often now, and I figured I'd share so others can see that they are not alone and crazy ;)
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 09, 2013, 03:29:49 PM
Argh! This is bad ;/

Even when I "manually" apply all changes in prefabs to call an event in another GameObject FSM - they..

A: Do not work - it appears as if the manual setup I made in Playmaker are just ghosts - they do not run.

B: Do not all show up when I right click in that global event that they all link to.

Even after pressing Apply, all the "ghosts" update visually nice, but under the hood - when I run the game, or when I check if the global event they should link to list them as "send by" - they do not work/do not appear. (Only some of them do)

The only way out of this mess is stop working with prefabs - they are a mess.

Manual updates on all individual objects for me till this is fixed, no more blue text.
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 09, 2013, 03:35:12 PM
On my PC at least, the global variable isn't being reset to 0 after the game has been stopped in the editor.

It looks like this is a bug when the Globals Window is open. In my tests it works properly if I don't have the Globals Window open - can you confirm the same?

I'll look into this. It might be related to other problems editing globals. Try keeping the Globals Window closed to see if that helps...

I'll try to get a fix out asap.
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 09, 2013, 03:41:41 PM
Uh!

I can confirm that I always have Globals variables window open (because it's a pain that one can no longer change variables from local to Global)

And.. I just discovered something worse, setting me back to last backup:

When trying to clean up: I wanted to delete all prefabs, so I only had 1 instance of the object. For "safety" (good call - not) I dumped that one working prefab as a new, and deleted everything else.

Importing that one good prefab then turned out to be the fabric of a prefab I made days ago - and not the one that I had up and running well and planned to clone.

Damn!

But yes, I can confirm, I always have the Globals window docked, I'll kill it before I move on ;/
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 09, 2013, 03:46:44 PM
It also only seems to happen in Unity4.x not 3.5.x, so I need to do some digging to figure out what changed in Unity...
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 09, 2013, 04:05:34 PM
Confirmed: Unity 4, Pro.
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 09, 2013, 04:33:54 PM
Confirmed: Unity 4, Pro.

Thanks. I think I have a fix. I sent you an invite to the beta. If you have a chance to test the fix that would be great!
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 09, 2013, 04:37:30 PM
Unfortunately at least one problem (we do not know if they are related) is not fixed by not having the Globals Variables open.

Look at the two screendumps. They are both instances of the same prefab.

The fact that there even is the "WallKick" state is because one prefab had this added, and "Apply" was pressed on that.

The GameObject linked to in one ("SubRoutines") is a prefab (and trying with a non-prefab gave same result) .

I am pretty sure PlayMaker used to include the GameObject in other prefabs when pressing apply.

Now I am back to that one who did not include the link being a "ghost" that I "manually" can update - but it's only visible in the PlayMaker window:

* It does not run as if my manual updates gave any effect.
* When I right click at the global event "WallKick", "Sent by", only the "original" is stated as sending, so the interface is showing me that I am linking, but under the hood it's not. And apparently I cannot force it either.

If I then try and Apply from one of the ghosts that I have forced to link, all other that where not working before has visual indication of being correct.

But Right clicking on the global event still only shows the very first link.. and so on, now everything is screwed up again - It's impossible to tell what is real and what is ghosts..
(https://lh5.googleusercontent.com/-YZtvDzJ_U8c/Udx2EcJNlhI/AAAAAAAAtTU/fry6RBy6i0Q/w369-h335-no/Sk%25C3%25A6rmbillede+2013-07-09+kl.+22.20.27.png)

(https://lh5.googleusercontent.com/-AIqXqX25XGI/Udx2EYSUzfI/AAAAAAAAtTQ/Iy9BgxncNSc/w365-h338-no/Sk%25C3%25A6rmbillede+2013-07-09+kl.+22.20.45.png)


PS: Just saw your post about inviting me to beta - I did not receive any mail - my mail address is fritslyneborg()gmail.com - where did you send?
Title: Re: Playmaker is changing the name of a global variable
Post by: Horror on July 09, 2013, 07:23:43 PM
In my tests it works properly if I don't have the Globals Window open - can you confirm the same?

Yep, this is the case for me too. So long as I don't have my globals tab active, the variables will return to their original values. I'm on Unity 4x as well.

I can probably work with this for now, just gotta remember to click off the globals tab before hitting the play button! Although, I'm kinda paranoid about touching anything now based on Frits' last post...
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 09, 2013, 11:07:02 PM
PS: Just saw your post about inviting me to beta - I did not receive any mail - my mail address is fritslyneborg()gmail.com - where did you send?

I used that address. Maybe check your spam...?

I'll look into the other issue you described.
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 10, 2013, 12:36:58 AM
Unfortunately at least one problem (we do not know if they are related) is not fixed by not having the Globals Variables open.

Look at the two screendumps. They are both instances of the same prefab.

...

I'm having a hard time reproducing this. Maybe I'm not following your steps properly. I was able to specify a GameObject (a prefab) in a Prefab Instance and Apply that change to the Prefab parent. It seemed to work as expected.

Can you make a quick video capture to show the repro steps? Does it happen in any project, or just with this FSM?
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 10, 2013, 04:03:05 AM
Here's a video of how I screw up my project for you :)

[EDIT: Just saw what an awful quality that is - here's another version of the same material, maybe it's better. I am not going to screw up my project again to make a video in higher quality - sorry for the lack of attention in the first place]

http://youtu.be/JMefPMGQgwM

Note in the end how another prefab changes (visually in PlayMaker - I do not think it's real, it's a ghost). I haven't seen that one before myself, I am glad I caught it on tape :D

As for your question:
"Does it happen in any project, or just with this FSM?"

Well, that's the two extremes, I'm landing in between:

Strange things has happened lately overall - and I am only working on one project.

As mentioned earlier, I did recently upgrade to 1.6.2.f3 - I am not sure how far I was behind, but it was not many versions. In fact I remember thinking that I only took the latest update, and then skimmed release notes, and noticed that I had probably missed a couple of updates.

I would like to save my project by lifting it over to a new / fresh installation, but as written earlier, when I work with the prefabs now (which is necessary in order to make "packages") they are really strange..

A zipped version of my project is 171MB, maybe if you have a place I can throw it up to?
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 10, 2013, 05:24:26 AM
Found the beta-invite, yes, spam folder, sorry.

Installing 1.6.3, wow, that state that had changed name all the sudden during the video shot (again sorry for lack of resolution, I hope you can see at least parts of what is going on) - that state is back to the name I gave it just by installing this!

So something rocked at the right spot.

So far so good.

As for the rest - maybe this project is so screwed up now that nothing can save it, not even 1.6.3, but basically I still have a mess:

I apply something to a prefab, and some instances get the update. I apply something else, and they all get it.

Parts they do not get / get at a random are links to prefab.

Parts they do get, are "visual drawings" (pictures of states) in the playmaker windows.

I keep getting annoying "Setup errors": Required field in (prefab)  - I think for every prefab that is linking to a prefab in a field, there is such an error (but I have not counted - would be insane to try)

All in all it's like a missing / corrupted link between "mother prefabs" and "instantiated prefabs".

Hmm..

Just (tried to) provoke 2 errors in one instantiated version of a freshly imported prefab. And only 1 is showing up. (Setup errors went from 9 to 10)

Deleted it, did the same thing again, now errors stays at 9. It's not worth trying to find heads and tales, it's a more fundamental thing.

Something is out of sync, basically :)
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 10, 2013, 06:38:10 AM
Alex: I have Google-drive-shared the project from the video with you.
Title: Re: Playmaker is changing the name of a global variable
Post by: FritsLyn on July 10, 2013, 03:09:12 PM
Alex, I have tested and stripped down, and here is a video showing the bug on a completely new project, RC3.

http://youtu.be/biyZhNBbT2U

I am sorry for the video being 6+ minutes long, after all this testing it's kind of hard to find up and down - and I'd hate to say something that was my own fault was a bug.

But I think that if you see through the video you will see an example of something totally wrong, in a completely stripped down environment.

It's a lot heavier than this in real life with global variables and several prefabs etc, but I wanted to take away all confusion, and this was the simplest I could get.

I hate to write this part, but I have to: I really hope this will be fixed, my entire work is in pieces - I can of course go back a few versions and find older versions of Playmaker, but still.

Thanks.
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 10, 2013, 03:39:21 PM
Thanks for the video. Don't worry, we'll definitely fix this! Playmaker doesn't handle Apply explicitly, Unity should take care of this. But I know they changed how this worked in Unity 4.x so I need to do some digging...
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on August 23, 2013, 09:01:33 AM
I posted an update on this issue here:
http://hutonggames.com/playmakerforum/index.php?topic=4739.0

We're working on getting a fix out asap!
Title: Re: Playmaker is changing the name of a global variable
Post by: Mayhem on September 26, 2013, 05:21:18 AM
So is the other bug fixed? I mean the bug which does not reset the Values of the Global Variables after running the game in the editor while the Global-Variables-Window is open.

It's nothing game-breaking, but it would be nice if this was also fixed.

(I'm experiencing this behaviour with the latest version of Unity AND the latest version of PlayMaker!)
Title: Re: Playmaker is changing the name of a global variable
Post by: charming_fox on March 17, 2016, 11:37:18 AM
Hi all,

I'm getting this error every now and then and it is an absolute mother******, basically unless I have a very recent backup then I have to hunt out hundreds of broken references to two global variables in particular (player and ui_canvas). Is anyone else still getting this?

Thanks
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on March 17, 2016, 11:49:29 AM
What version of Playmaker are you using? We don't have reports of this bug happening in 1.8.
Title: Re: Playmaker is changing the name of a global variable
Post by: charming_fox on March 18, 2016, 05:18:40 AM
PM is 1.8.0f43 and Unity is 5.3.2f1. I'm about 80% convinced it happened when I applied changes to a child within a prefab in a scene by accident, normally I apply changes to the root object. The result is that any reference to the global game object 'player' is now a reference to the global game object 'canvas'.
Title: Re: Playmaker is changing the name of a global variable
Post by: jeanfabre on March 24, 2016, 03:36:32 AM
Hi,

 I am trying to repro this, but I am having a hard time.

Where was the global used, was it inside this prefab? what did you edited in the prefab instance child, an Fsm or something else?

Bye,

 Jean
Title: Re: Playmaker is changing the name of a global variable
Post by: hannesdelbeke on April 12, 2016, 11:58:33 AM
I also have this happen to me several times in the past weeks
just happened today on a very big FSM
lucky enough i could roll back and redo my changes

I have a prefab called "manager", with several chilren
made a new gameobject variable inside of the FSM attached to it
then dragged it in the scene so it becomes a instance
the FSM has 3 nodes with action "set gameobject action"
i dragged some children from the "manager" in the slots for "set gameobject action"
then clicked apply on the "manager" instance
now going back to the prefab a lot of gameobject variables are shuffled

playmaker version is 1.8.0f43 unity 5.2.3.f1 (not 5.3!)

i think in the past when it got corrupted it was similar.
my current workaround is
dragging gameobjects directly in actions isntead of making a variable, exposing it in the editor, and dragging it in the variable slot of the fsm
and lots of backups
Title: Re: Playmaker is changing the name of a global variable
Post by: jeanfabre on April 20, 2016, 02:41:23 AM
Hi,

 You should report this using the bug report.

It's never a good idea to work on the instance in general. I only do the very strict minium that Unity impose, like modifying deep hierarchy and all, everything Fsm wise, I only work on the prefab itself.

Bye,

 Jean
Title: Re: Playmaker is changing the name of a global variable
Post by: hannesdelbeke on April 20, 2016, 10:21:47 AM
i only work in the instance to drag deep hierarchy stuff in the variables instead of using find
Title: Re: Playmaker is changing the name of a global variable
Post by: terri on November 28, 2016, 02:41:29 PM
I've had this happen too, today it was pretty bad :/
I changed an action which was referencing a global variable, and it made the same change on other FSMs on the prefab, breaking a bunch of stuff

I've had it happen before but I was always not 100% sure what happened, but this time it was just too obvious. I'm guessing it does have to do with applying changes on prefabs, but since you only have access to the first level of children on the hierarchy, you kinda have to do it sometimes, it really shouldn't break everything
Title: Re: Playmaker is changing the name of a global variable
Post by: terri on November 29, 2016, 06:51:38 AM
To extend on this, it changes the global variable not just on the local prefab's other fsms, but also on other completely unrelated prefabs.

I also just had a problem where it changed the name of the global variable??? I used to have globals/BRAIN and globals/UI, and after switching one from the other in a FSM, my globals now list UI two times and no BRAIN

I'm going to attempt to replicate this on a blank project
Title: Re: Playmaker is changing the name of a global variable
Post by: terri on July 19, 2017, 01:08:38 PM
So, this is still happening.

I can't figure out exactly what triggers it, but it has to do with editing actions on a scene and hitting apply.

I set up an action today referencing a child and when I hit play, I got a bunch of errors and turns out my prefab lost all the references to a global variable.

I've seen cases where if you changed a reference from one global variable to another, it will change every other reference, as if you had rename the variable instead of just picking another one.

This really sucks, I already don't rename global variables since I know that will likely break everything, but I almost feel like I shouldn't use global variables at all since they break out of the blue and its a ton of work to track them down and fix everything.
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on July 19, 2017, 10:06:36 PM
Hi,
It has been a long time ago that i had this issue too.
What unity and Playmaker version are you on?

How are you backing up your project?

If you use something like sourcetree you could revert the global file to reduce the damage, if it happens.
It is not a solution, but it reduces the damage.
Title: Re: Playmaker is changing the name of a global variable
Post by: terri on July 20, 2017, 08:08:18 AM
Unity is 5.6.1f1, Playmaker is 1.8.4

I backup often but manually. (zip the project + dropbox). The tricky bit is I've had instances where I'd work on something for a few hours after a backup, and this will mess everything up. OK, couple hours lost but I revert to the backup. So I work on things again and the exact same thing happens...

Another thing that sucks is that since it doesn't always throw errors (switching a variable doesn't), you only catch this once you run through the FSM by chance while playtesting and things don't work as they should

also sometimes I'll catch the error, fix it and run the game and the FSM will seem to revert back to the wrong variable? it so weird
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on July 20, 2017, 11:28:12 AM
Hi,
It is indeed weird, but maybe you should look into using sourcetree and github so You can for example view a change log for a single file (pointing to playmaker/Resources/PlayMakerGlobals.Asset ) so you can see if something has changed on the file (this includes Global Variables and Global Events.)

If you don't want to get into sourcetree, you could use import/export globals.
When you click on the file playmaker/Resources/PlayMakerGlobals.Asset
you can see import/export Globals and also what is on your global file.
Export it and when something went wrong,
import the file
But you will need to export every time you add/remove globals.
Also i think the 'renamed' globals will still be there after import.

I have not tested this but i think it should work.

Have you also send i bug report inside unity?
You can find it under Playmaker/Tools/
Title: Re: Playmaker is changing the name of a global variable
Post by: terri on July 21, 2017, 05:13:21 PM
ah, cool thanks, will check that out - though that is for when the globals get messed up right? I mostly have the issue where the action inside prefabs that are using a global variable will break

I should totally send a proper bug report I have not
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on July 22, 2017, 01:17:55 AM
Hi,
Quote
I should totally send a proper bug report I have not

Please do :)
and give as much give as much detail as you can.
If you do, also ad a link to this Post :)
Title: Re: Playmaker is changing the name of a global variable
Post by: allornothing on August 11, 2017, 06:54:02 AM
Just to add a +1 for this issue happening in 1.8.2 with 5.6.0p2

We're finding variables referenced in actions change of their own accord. Looking at the thread it might be related to applying changes to a prefab when it's a child of another object (although with UI prefabs this is hard to avoid). We don't have global window open, but do have PM window open.

It's a very nasty bug! We've been spending days fixing issues caused by this without us knowing why.
Title: Re: Playmaker is changing the name of a global variable
Post by: HeathClose on August 12, 2017, 04:29:33 PM
just had this happen.

I changed a prefab to reference a new global variable Checkpoint game object, and when I went to test the checkpoint system... my player wouldn't move... and what happened was that my buttons changed their reference from the global "player" to this new checkpoint game object..


However.. the global "player" is gone, and now there are two checkpoint globals

one of these is supposed to be player...

(https://www.dropbox.com/s/a13bggts4ttdurh/Screenshot%202017-08-12%2015.32.38.png?dl=1)

I checked the collaboration changes... looks like my player prefab changed also.  the get owner says player in the action.. but player is not listed in the globals.  I had to create a new player global

also, anything that referenced that changed player global now reads the double of the checkpoint global...

furthermore... the double of that global is not listed, since I just made the change I will just delete them both and see what happens

(https://www.dropbox.com/s/yirro42bc2ybsh5/Screenshot%202017-08-12%2015.39.16.png?dl=1)

1.8.5
2017.1.0f3
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on August 12, 2017, 10:05:25 PM
Hi,
Thanks for the detailed info.
did you change the prefab inside a scene (hierarchy) or in the project folder?

Can you try yours steps to see if it happens again?

Can you submit a bug report inside unity (go to playmaker/tools)
and add a link to this thread.
Title: Re: Playmaker is changing the name of a global variable
Post by: nazbee on August 15, 2017, 09:49:37 AM
i had something similar happen today, was very strange. Playmaker 1.8.4 Unity 5.6.2f1

One of my global variables just poof, disappeared. Stopped showing up in the global variables list but was still showing inside some actions which disappeared when selected.

Ended up creating a new global with the same name and manually reconnecting.

Sorry- no steps to reproduce, caught me completely off guard. Its a little worrying now whether can trust playmaker wont just spontaneously break the project ...
Title: Re: Playmaker is changing the name of a global variable
Post by: HeathClose on August 15, 2017, 09:58:22 AM
Hi,
Thanks for the detailed info.
did you change the prefab inside a scene (hierarchy) or in the project folder?

Can you try yours steps to see if it happens again?

Can you submit a bug report inside unity (go to playmaker/tools)
and add a link to this thread.

I tried to submit the bug report and get this error

Error Submitting Report:
Cannot connect to destination host
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on August 17, 2017, 12:18:56 AM
HI,
ok so i guess you are on unity 2017.1

do you have playmaker 1.8.5?
Title: Re: Playmaker is changing the name of a global variable
Post by: HeathClose on August 17, 2017, 09:19:50 AM
HI,
ok so i guess you are on unity 2017.1

do you have playmaker 1.8.5?
yes
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on August 18, 2017, 12:47:55 AM
HI,
It is a unity bug and should be resolved in 2017.2,
but i have contacted Alex already :)
Title: Re: Playmaker is changing the name of a global variable
Post by: Dakk on September 21, 2017, 12:24:54 PM
+1 to this frustrating bug.

PM arbitrarily switches global variables.  Switching them back only results in the problem re-surfacing in another FSM or template. 

Yes, I use version control, but this went unnoticed this time for at least 5 days of work because I was focused on a different section of my game that was unaffected.  I don't want to lose all the work.

I have tried replacing the vars with new ones- it just happens now on the new vars.  I even tried re-structuring the setup so those vars weren't used- corruption crept into the new setup.

Has anyone found a fix?  Editing the global vars file?  Replacing actions?

Does anyone know where the corruption resides so I can track it in source control and maybe patch it myself? 

How sure are you that it will be fixed in the next Unity release, and will that fix corrupted files, or just prevent 'clean' files from getting corrupted?

Any help appreciated!


Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on September 21, 2017, 12:39:30 PM
Hi,
Globals are stored in playmaker/Resources/PlayMakerGlobals.asset

The corrupted files will probably not be fixed on updating.
Title: Re: Playmaker is changing the name of a global variable
Post by: Dakk on September 21, 2017, 01:07:07 PM
Thanks for the reply, I am quite familiar now with the globals file (unfortunately).
I have compared the history in version control- but I am not certain how to locate the corruption. In fact, I am not even certain that file is where the corruption lies.
Title: Re: Playmaker is changing the name of a global variable
Post by: Dakk on September 21, 2017, 05:37:35 PM
A follow-up in case someone finds themselves in a similar situation where they do not catch it in time for a simple version control rollback (the safest fix)-  I believe I have removed the corruption from my project. 

It didn't seem like the corruption was in the actual global variable file- I couldn't see any problems in the syntax going through the version history. 

It seems to have something to do with the relationship between prefabs and scene instances- like others have noted.  I was not ever editing the scene instance, only the prefabs, but I still encountered this corruption.  To fix it, I broke all my prefab connections then deleted the prefabs from the project.  I then painstakingly re-set the correct variables in all the FSMs in the scene and all the templates. 
This seems to have worked.  At some point I will need to convert the scene objects back to prefabs- hopefully that will not bring back the corruption.
Title: Re: Playmaker is changing the name of a global variable
Post by: craigz on December 06, 2017, 10:15:40 PM
Just wanted to put my findings here for anyone else who's had this issue!

I was able to fix it by editing the PlayMakerGlobals.asset file manually (though still had to manually reconnect the NEW global variable to where it was disconnecte).

Sauce: http://hutonggames.com/playmakerforum/index.php?topic=16254.msg75824#msg75824

-craigz
Title: Re: Playmaker is changing the name of a global variable
Post by: craigz on July 19, 2018, 09:56:29 PM
Following back up on this thread.

Just had this happen again today. Specifically the renaming bug, not a duplicate global variable.

Getting ready to roll back and redo half a day of work  >:(

Playmaker 1.8.9
Unity 2017.3.1f1

Still not sure what made it happen, but one of my used Global variable gameobject's name just got changed to a general and vague local variable I use a lot (temp_go_1) so I've no idea where/when it happened.

Ugh.

-craigz
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on July 20, 2018, 10:41:12 AM
Sorry to hear that :(
Have you tried updating to 1.9.0?

Title: Re: Playmaker is changing the name of a global variable
Post by: terri on July 31, 2018, 11:20:27 AM
Personally I've started avoiding Global variables as much as I can. If I am using them I make sure to never swap one for another in an action, instead I'll drag a blank action and re-set all the values but with a new global variable.

I'd consider it broken, and it has been for a while! I'm on Unity 2017.4.1f1 Playmaker 1.8.9
Title: Re: Playmaker is changing the name of a global variable
Post by: Krillan87 on September 18, 2020, 11:39:47 AM
Just wanted to say that this bug is still live and kicking. I just had around 350 variables changes, it took me a solid 2h to get everything back and now I am scared as fuck to even open the Global variables window to see what happening. I have PM version 1.9

Any update on this? Do we know what is causing it? Our game is depending on playmaker and right now it feels very very shakey!
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on September 18, 2020, 02:20:14 PM
Hi.
Did you try restarting unity before changing.

Also you should also use some version control like github, its very important to always have backups.

and with github you can easily revert changes :)
Title: Re: Playmaker is changing the name of a global variable
Post by: Krillan87 on September 18, 2020, 05:25:49 PM
Hi.
Did you try restarting unity before changing.

Also you should also use some version control like github, its very important to always have backups.

and with github you can easily revert changes :)

Yeah I do backup at the end of the day but this happened around lunch break so it was still faster to redo everything then stat from yesterdays backup.
Title: Re: Playmaker is changing the name of a global variable
Post by: djaydino on September 18, 2020, 06:27:05 PM
Hi.
You should look into github as you could just revert the Globals file without loosing other changes :)

Currently you have Github Desktop which is easier to use than git
Title: Re: Playmaker is changing the name of a global variable
Post by: Fat Pug Studio on September 20, 2020, 09:34:16 AM
Avoid using globals, they're a freaking mess. I threw out all globals from the project, i made a GlobalsManager FSM that holds all "global" variables locally and i use get fsm float/int/whatever from it.

Though this effectively bans you from changing variable names ever.
Title: Re: Playmaker is changing the name of a global variable
Post by: Krillan87 on September 20, 2020, 10:25:47 AM
Avoid using globals, they're a freaking mess. I threw out all globals from the project, i made a GlobalsManager FSM that holds all "global" variables locally and i use get fsm float/int/whatever from it.

Though this effectively bans you from changing variable names ever.

Yeah I have always been reluctant to use globals but in our project we only use 3 (The three main characters)game objects at global since they are used a lot. However, your strategy is maybe something to consider
Title: Re: Playmaker is changing the name of a global variable
Post by: Fat Pug Studio on September 29, 2020, 01:46:18 PM
Yeah i use global variables for main camera, player, "globals" manager itself, array proxy object that stores arrays for data and that's it, they have few thousand calls so it made sense to keep them in globals. Until Alex makes things better (in PM2 hopefully), that's the way to go, along with some nice groups.
Title: Re: Playmaker is changing the name of a global variable
Post by: AtomicJoe on August 06, 2022, 09:01:33 PM
Is this bug still alive?
I had this bug in 2013 (!) and was the reason I completely ditched Playmaker.
Now I see reports of 2020 of the bug still kicking!
I was planning to use Playmaker again, but if a global bug like this one hasn't been fixed in 9 years, I really don't know what to think about Playmaker!
Title: Re: Playmaker is changing the name of a global variable
Post by: Alex Chouls on August 13, 2022, 12:52:46 AM
I think we fixed the last edge case where this happened in 1.9.1p4 released beginning of '21. Unity made a lot of changes to the ways prefabs work in the last 10 years, so it was a tricky bug to reproduce and fix across unity versions. This was definitely a cursed feature :-[
Title: Re: Playmaker is changing the name of a global variable
Post by: AtomicJoe on August 13, 2022, 01:06:55 AM
Thanks for the heads-up Alex!