playMaker

Author Topic: Global variables completely lost from prefab on Play [SOLVED]  (Read 13194 times)

Krileon

  • Full Member
  • ***
  • Posts: 107
For some reason for one of my prefabs the global variables are completely lost on Play. During editor they work fine and I can select them fine. As far as I am aware my other prefabs using globals are still working fine. Please see the attached sceenshots. Does anyone have any idea what's going on?

Edit: Just checked my other prefabs and they're losing their globals too on play. This is a massive massive issue as it basically has broken my game.
« Last Edit: April 06, 2013, 05:20:06 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Global variables completely lost from prefab on Play
« Reply #1 on: April 01, 2013, 07:37:45 PM »
What version of Playmaker and Unity are you using?

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: Global variables completely lost from prefab on Play
« Reply #2 on: April 01, 2013, 07:40:19 PM »
Unity 4.1.2f1 and PlayMaker 1.5.4.f3.

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: Global variables completely lost from prefab on Play
« Reply #3 on: April 01, 2013, 08:52:22 PM »
Ok, did some more testing and the globals are working for 1 frame then lost (changed to None as shown in my screenshots). My project is basically completely on hold until this can be fixed as it depends on some globals. Should I be using some other way to handle the globals instead of using globals? Maybe a single FSM that holds the variables instead?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Global variables completely lost from prefab on Play
« Reply #4 on: April 02, 2013, 12:04:50 AM »
Was it working in Unity 4.1?

4.1.1 broke a lot of asset store tools. Maybe some stuff remains broken in 4.1.2.

I haven't updated to 4.1.2 yet, but will do so ASAP to test...

BTW, is it a display bug, or is the FSM actually broken?
Also, if you run the project without the playmaker editor open, does it run as expected?

Lobohotpants

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Global variables completely lost from prefab on Play
« Reply #5 on: April 02, 2013, 12:52:00 AM »
I think I had a similar problem and it was because I filled the global variable with a prefab from my assets and not my scene.  To fix it I use a "get owner" on each of the prefabs that are supposed to be in the global variable and fill the variable at run time. 

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Global variables completely lost from prefab on Play
« Reply #6 on: April 02, 2013, 01:21:27 AM »
Sorry for this OT, but... I see in the picutres that there are FSM with more starting points.

How is that possible?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Global variables completely lost from prefab on Play
« Reply #7 on: April 02, 2013, 02:36:26 AM »
@megmaltese: what do you mean by starting point?

 fsm have only one "START", but then you can reroute transitions back to it the way you want. is that what you mean?

bye,

 Jean

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Global variables completely lost from prefab on Play
« Reply #8 on: April 02, 2013, 02:48:38 AM »
No.

There is START, Escape and Kill.
For the little I know, I can only have START.
I didn't read or see anywhere else those other starting points (or whatever they are  :o )

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Global variables completely lost from prefab on Play
« Reply #9 on: April 02, 2013, 02:53:20 AM »
Hi,

 That's "Global transitions" for you. Right click on a state and select "Add Global Transition", then it will appear so, and it means that if you call that event somehow, it will enter that state.

It's a critical feature of playmaker, it's very important that you master this concept. Have you watched the various screencasts and tutorial videos on Playmaker?

bye,

 Jean

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: Global variables completely lost from prefab on Play
« Reply #10 on: April 02, 2013, 08:10:51 AM »
Was it working in Unity 4.1?
Yes, it was working fine in 4.1. After the upgrade I believe is when it broke, but I do not recall exactly when as I just now noticed it while working on my new UI.

BTW, is it a display bug, or is the FSM actually broken?
It's broken. The globals are lost and PlayMaker, if debugging is on, will throw an error stating the required variables are missing. The states that use those globals also will not function unless they use the global on the first frame as any frames after that the globals are lost.

Also, if you run the project without the playmaker editor open, does it run as expected?
No it does not run fine with the PlayMaker editor open or not. However, if you have the editor open and press play it will LOOK fine, but it won't be as once you close and re-open it does as seen in my screenshots.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Global variables completely lost from prefab on Play
« Reply #11 on: April 02, 2013, 02:11:52 PM »
Hi,

 That's "Global transitions" for you. Right click on a state and select "Add Global Transition", then it will appear so, and it means that if you call that event somehow, it will enter that state.

It's a critical feature of playmaker, it's very important that you master this concept. Have you watched the various screencasts and tutorial videos on Playmaker?

bye,

 Jean

I took the first 8 tutorials from basics but didn't see this feature (or forgot about it lol).
Very cool.
Anyway, I'm quite in my project atm and I managed to not use global FSM, but surely they can come very useful in some situations.

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: Global variables completely lost from prefab on Play
« Reply #12 on: April 02, 2013, 09:30:40 PM »
Has anything been found in regards to this? It has my project completely on hold. This seams like a pretty massive massive bug.

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: Global variables completely lost from prefab on Play
« Reply #13 on: April 04, 2013, 09:16:05 AM »
Tried deleting and re-importing PlayMaker as well as my globals with no luck. Issue still present. Please can there be some movement on this? My project is at a complete stand still as it depends on some globals. The globals are lost after the first frame as shown in my screenshots.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Global variables completely lost from prefab on Play
« Reply #14 on: April 04, 2013, 09:21:42 AM »
I would revert to an older Unity version, if it broke after a Unity patch then it seems like the problem is fairly clear... Especially so after considering the huge volume of issues they've had with the last 2 patches.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D