playMaker

Author Topic: FSM Exposed Variables Reverting to Prefab Values  (Read 887 times)

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
FSM Exposed Variables Reverting to Prefab Values
« on: March 26, 2021, 04:42:05 PM »
Hello!

I began noticing an issue where exposed FSM variables were not saving upon closing and opening my game project.

For example, I have a prefab instance with an FSM component. The FSM has several exposed variables I can change in the scene through the inspector. When I do so, save the scene, close and re-open Unity, the variables appear to have reverted to the prefab defaults. If I run the scene, the FSM behavior will reflect these default values. Furthermore, if I try to edit the variables, it will break the prefab connection.

After testing a few things, I found a workaround for the time being:

I can place a fresh prefab of that same game object into the scene and edit one of it's variables. Then when I re-load the scene (no saving necessary), I will find that the FSM variables in the problematic game object have returned to their modified values and the prefab connection is still intact. I am also free to change the variables with out fear of breaking the prefab connection.

While the problem returns every session, I don't necessarily have to perform these steps each time. If I skip a session and attempt the workaround in the following session, it will still repair the prefab instance. However, failing to do this workaround before building the project will result in the issue persisting into the build itself.

I've noticed this issue with one or two different prefabs with any type of variable but it does not seem to be effecting all game objects with FSM components.

Does this issue sound familiar to anyone? I'd really appreciate some insight on how to potentially fix this problem.

I'm using PlayMaker 1.9.0p20 and Unity 5.6.4f1

Thanks :)

Weak Interactive

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 33
Re: FSM Exposed Variables Reverting to Prefab Values
« Reply #1 on: March 27, 2021, 07:35:10 PM »
Hey,

I don't have a solution to this, but I just wanted to share that I've never experienced this exact issue before. However, the oldest version of Unity I've used with Playmaker was one of the 2019 versions.

I just tested this in my current project, and all exposed variables on prefab instances remain changed after I reboot my project (my game would be screwed if that wasn't the case haha). I'm currently using Unity 2020.3.1f1 with Playmaker, 1.9.1.p4, so it's possible that it was a bug fixed in a more recent version of Unity or Playmaker.

I have, however, experienced issues where prefab instances randomly break after launching my project, and I have to re-add them to the scene. I have also experienced issues where prefab instances break only while in play mode, and the only way to fix them is to reboot Unity.

I would say that upgrading to newer versions of Unity/Playmaker might help, but prefabs still have so many issues even in the latest versions :(

Good luck, I hope someone comes by with an actual solution.

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Re: FSM Exposed Variables Reverting to Prefab Values
« Reply #2 on: March 29, 2021, 08:19:50 AM »
Hey,

I don't have a solution to this, but I just wanted to share that I've never experienced this exact issue before. However, the oldest version of Unity I've used with Playmaker was one of the 2019 versions.

[...]

Thanks for the reply!

It could be a case of the older versions still having these bugs in them. I've been working in this same project for a couple of years and only started seeing the problem recently. Maybe it has something to do with the number of different FSM prefabs I have in the project since after all this time, it adds up to quite a lot.

I should consider updating the project to a newer version of Unity and PlayMaker but I'm not in a position to do so at the moment. If a solution never arises, I may do just that.

[...]

I have, however, experienced issues where prefab instances randomly break after launching my project, and I have to re-add them to the scene. I have also experienced issues where prefab instances break only while in play mode, and the only way to fix them is to reboot Unity.

[...]

There are a hand-full of other times where I have had random occurrences like this happen too. A scene re-load or a Unity re-boot usually fixes things in those cases so I attribute the problem to long running sessions stirring up trouble. But maybe there is just some quirks in the Unity prefab that cause PlayMaker scripts to act up.


Thanks again for the reply. I'll keep an eye on this thread in case another member happens to know some more about what could be going on.