Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: agelvik on March 08, 2021, 12:09:36 PM

Title: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: agelvik on March 08, 2021, 12:09:36 PM
Variables get swapped around sometimes in prefabs for some reason.
Prefabs are not getting properly reverted when attempted. Nothing happens when you try use Revert All.

My workaround is to delete existing prefabs in the scene, and place new ones from project folder.
Another workaround is to Edit the parent prefab, delete the actions with wrong values, add new action and insert desired variable again. This updates the prefabs in the scene to correct values.

The Revert bug seems to occur when you Edit prefab FSM instance. After doing so there no way to revert back to default values.
I can't explain how the variables are getting switched around though, it happens when I'm not paying attention. Suddenly action values are containing incorrect variables, as seen in the video.

In the attachment you'll find 2 pictures showing which variable values are correct, and which are wrong.

Video:
https://www.dropbox.com/s/654l8hei12w09kd/prefab_issue_playmaker.mp4?dl=0
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: djaydino on March 08, 2021, 03:12:03 PM
Hi.
on PM 1.9.0x i usually solve it by restarting unity.
something else you can try is PlayMaker/Tools/Update...FSMs
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: Alex Chouls on March 08, 2021, 04:28:17 PM
Are you using the latest version? 1.9.1p4
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: agelvik on March 08, 2021, 04:40:58 PM
Sorry, I forgot to mention versions.

I'm using 1.9.0.p20, unity 2020.1.14f1.

I'll update and let you know if it still persists. :)
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: agelvik on March 09, 2021, 05:02:31 AM
I've updated to 1.9.1.p4, and sadly I've encountered these bugs again. Revert All seems to still not work & variables are getting swapped around without knowing exactly how.

It could be code from the past that hasn't fully transitioned to the newest version yet, so future Prefabs & Fsms may not have this problem. Either way, this is how things currently are atm for me. Restarting have no effect.

Variable swap: (Left is unknown undesired variable swap, right is default desired values)
https://www.dropbox.com/s/mabknbbqygmdmym/swap-compare.png?dl=0

Revert All:
https://www.dropbox.com/s/8ohcwzso31hftj7/revert-all_notwork.mp4?dl=0


I'll also throw this one in here, since it's kinda related to variables getting swapped around. Again, it's from the previous version, so it may not occur in the future.

On runtime, Run FSM contains wrong input values, it's all swapped around. However in Debug it seems to be correct, so the final results seems to be giving the desired result. Still, it's confusing to see all the input values swapped around.

Video:
https://www.dropbox.com/s/r9mz2zbhjdja8se/run-fsm_incorrect-input-values.mp4?dl=0


Update:
Prefab variable swap partly reproduced. It seems like the row the action is placed at matters. In the video it starts with undesired variable swap, then after duplicating and keeping old actions, the desired variables persist. However when I delete the old actions, the swap reoccurs.

Video:
https://www.dropbox.com/s/s3ved8l95nrhze7/variable-swap-prefab.mp4?dl=0


Update 2
Variables still not updating properly to default values. In this case, I don't even get option to revert or apply changes. This is from a freshly made FSM.

https://www.dropbox.com/s/dvh0v081ncba611/prefab%20variables%20not%20updating%20still.png?dl=0
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: agelvik on March 10, 2021, 11:14:21 AM
Here's an update regarding variables getting swapped around.

By the looks of it, the prefabs with FSMs in the scene can't keep up with actions getting reordered and duplicated, where it overwrite variables based on the action order...

Whatever it might be, I can't quite put it into words. Here's a video reproducing the variable swap from start to finish.

Video:
https://www.dropbox.com/s/ljjn1kz5yfne709/swap-bug_reproduced.mp4?dl=0
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: Alex Chouls on March 11, 2021, 12:44:38 AM
Thanks for the videos! Unity is doing something I don't understand when returning from the prefab stage. For some reason some instance data is not updated. A workaround seems to be restarting Unity, but obviously this is not ideal! I've contacted Unity and hopefully I can figure out the problem with them. Thanks for your patience!
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: Alex Chouls on March 11, 2021, 03:48:50 AM
There's an experimental fix for this issue in the latest beta build.
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: agelvik on March 15, 2021, 04:25:46 AM
Was unable to reproduce it in the latest build, seems to be working as intended now!

Apply & Revert prefab instances seems to be more solid as well, it's doing what it's supposed to now. :)
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: Gua on March 21, 2021, 01:58:12 PM
There's an experimental fix for this issue in the latest beta build.
Can I get access to that build? This issue created so much pain and suffering, that I willing to install alpha version of next update.
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: djaydino on March 21, 2021, 07:54:18 PM
Hi.
You can pm or email your invoice to alex and also your google account (as files are on google drive)
Title: Re: Unable to revert Prefabs properly and unexpected variables getting swapped
Post by: Gua on March 21, 2021, 08:21:13 PM
Hi.
You can pm or email your invoice to alex and also your google account (as files are on google drive)
Thanks! I've already got invited.