Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: jess84 on February 04, 2014, 09:39:45 PM

Title: Global Variables changing after playing in Unity then stopping
Post by: jess84 on February 04, 2014, 09:39:45 PM
I've seen this mentioned a few times across the forums, and I think people have given example projects with repros.

My question is; Is this being addressed?

It's so infuriating creating a build to test, running a scene and seeing that it doesn't work because a global bool or float isn't on the value it's supposed to be. You then have to go through them all and flick them back to the right values.

I appreciate that this might be hard to track down, and happens seemingly randomly - but it seems to happen to lots of people.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: Alex Chouls on February 05, 2014, 12:58:35 AM
I'm trying to repro the bug here but so far haven't been able to...

It might have something to do with which windows are in your layout (which isn't preserved in sent repro projects). Try using a default layout to see if that fixes it, then add windows back into the layout until it breaks again...

I'd like to get a fix into the next update!

 
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: jess84 on February 05, 2014, 12:19:24 PM
I shall look into that.

FYI - My layout contains the following differences to the default layout:

Inspector Window: I have 2 tabs added - PM Actions and PM Global Vars
and I have separated the Game and Scene tabs so that both windows are always visible.

Those are my only changes.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: jgalvezpa on February 13, 2014, 11:55:09 PM
i have the same problem the global variables disappear please fix it
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: terri on March 05, 2014, 06:06:34 PM
I get this too, not often but when it happens I have to roll back to a previous back up, since its just too much stuff that gets messed up, and some of them don't show up as an error.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: RAWilco on March 08, 2014, 03:59:43 PM
I can confirm that what Alex Chouls suggested does work.

For some reason, the Global Variable values are not reset after testing a scene if you have the Global Variables Editor Window arranged somewhere as a tab in your layout.

Simple solution: Just close the Global Variables Editor Window and only open it when you need to.

It can be a bit annoying not having all your variables there for reference all the time, but it fixes the problem.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: terri on March 10, 2014, 04:56:45 PM
Doesn't fix the problem for me, still happens.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: jess84 on March 28, 2014, 08:06:25 PM
Is this going to be fixed soon?

It's quite infuriating either not being able to test in Unity, or run the risk of lots of globals being set to values you don't want.  (e.g right now, I have to go through and change 100 bools for each of my levels so say if they're locked/unlocked).

As lots of people have reported this, surely recreating it shouldn't be too difficult?

Oh, off to change lots of global variables....    :'(
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: Alex Chouls on March 29, 2014, 12:25:07 AM
We haven't been able to repro this here... Do you have other third party assets in your project? E.g., Particle Playground was causing some problems, but their latest version should fix the issue...
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: jess84 on March 29, 2014, 11:44:17 AM
Just iTween and FX Mega Pack
(and ArrayMaker)

Other people with this problem - what about you?
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: Alex Chouls on March 29, 2014, 02:27:59 PM
Can you submit a bug report so I can get more info on your setup. Are you definitely using the latest version of Playmaker? Can you share a small project that shows the problem?
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: jess84 on March 29, 2014, 02:52:53 PM
1.7.7.f6

however this problem has occurred on the previous two versions that I've been on in the last 6 months too.

Title: Re: Global Variables changing after playing in Unity then stopping
Post by: Alex Chouls on March 30, 2014, 12:39:26 AM
What version of Unity? Does it happen in a new project with just Playmaker?
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: jess84 on March 30, 2014, 03:15:11 PM
4.3.4

I started a new project a couple of hours ago, to play around with Arraymaker, and it's just occured again - on this new project.

This time, I just have Playmaker and Arraymaker (plus the arraymaker samples). No other 3rd party packages.

Pretty much default window layout, just extra tabs on the Inspector window for Global Variables and Actions.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: ben135 on April 01, 2014, 08:53:08 PM
I am running into this problem as well. Global variables are stuck to what they were when I stopped the game previously (not pause).
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: Alex Chouls on April 02, 2014, 12:05:25 AM
Can you provide more info? Third party assets? Arraymaker?

If anyone experiencing this problem can log a bug and include a small project with repro steps that would be most helpful!

In the meantime, while we figure this out, a workaround would be to have an FSM that initializes global variables when you press play. Set global variable values in that FSM instead of the globals window.

Title: Re: Global Variables changing after playing in Unity then stopping
Post by: ben135 on April 09, 2014, 03:13:26 PM
In your mentioned workaround, I tried setting up a state using an action (ex. "Set Float Value") to set a global variable to 0 but when I run the game, the state never uses the action.
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: Horror on July 12, 2014, 11:23:46 PM
This issue still seems to be lingering. In my experience it only starts happening after updating an existing project to a newer version of PlayMaker. I just updated a project from 2013 to latest Unity + PlayMaker and my globals are no longer resetting after playing in the editor (only happens if the Globals window is active).
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: doppelmonster on May 28, 2015, 06:35:27 AM
2015 unity5 and the problem still exist.

Just spend several hours debugging android to recognize that i have this bug.... :(
Title: Re: Global Variables changing after playing in Unity then stopping
Post by: doppelmonster on May 28, 2015, 06:41:43 AM
Fix: right click in the global var inspector and uncheck "Auto Refresh on Focus"

Just discovered the fix. needs further checking....