playMaker

Author Topic: Playmaker changes variables in prefabs [SOLVED WITH UPDATE]  (Read 2022 times)

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Playmaker changes variables in prefabs [SOLVED WITH UPDATE]
« on: February 25, 2021, 01:55:01 PM »
This has happened several times in the last few days. Reverting in Collab does not fix it, and the only solution I've found is to delete the project folder and unzip a backup I made manually.

1. I set up an FSM with multiple variables. I have 'ObjectA' and 'ObjectB' used in many actions.

2. Run the game, things aren't behaving as expected. Pause the game and inspect the FSM. The actions are using the wrong variables - where it should be ObjectA, it's got ObjectB'.

3. Open the prefab and inspect the FSM. The variables are not how I saved them. ObjectB is where ObjectA should be.

4. 'Fix' the actions by changing it back to ObjectA

5. Run the game - same thing happens.

6. Open prefab, 'fix' the actions by switching from ObjectB to ObjectA.

7. DELETE ObjectB variable from FSM.

8. All the actions that were mysteriously changing from A to B now have 'None' in the dropdown, even though I manually changed them to A before deleting B

Has anyone experienced this? It happened occasionally before the latest update, but seems to be happening more frequently now (either that or I'm just unlucky).
« Last Edit: June 23, 2021, 08:05:56 PM by ToxicFrog »

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #1 on: February 25, 2021, 01:59:52 PM »
Forgot to mention: I can also 'fix' it by re-creating the state from scratch. Re-creating the action alone doesn't seem to fix it, but re-creating the entire state does.

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #2 on: February 25, 2021, 02:37:39 PM »
Also, it seems that once a prefab gets this 'curse', it continues happening across multiple FSMs in the prefab hierarchy.

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #3 on: February 25, 2021, 03:25:21 PM »
Since this only appears to happen to prefabs, I unpacked/deleted/re-created the prefab in hopes that might fix the curse.

I'll report back if it seems to have helped.

*EDIT: It did not help. It's still happening...
« Last Edit: February 25, 2021, 04:06:02 PM by ToxicFrog »

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #4 on: February 25, 2021, 04:12:10 PM »
No idea if they are related, but I am renaming many actions to make my FSM flow easier to read. I'm going to stop doing that and see if it makes a difference.

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #5 on: February 25, 2021, 05:55:03 PM »
Trying to give the devs some clues in hopes of troubleshooting:

1. Just renaming some Variables caused this to happen again. Some of the variables have 'Input' checked.

2. The prefab is in a 'Resources' directory, and is instantiated via PUN2

3. Some variables are network synced

^Just throwing this out there in case it give you any ideas

*EDIT: I'm not using any global variables
« Last Edit: February 25, 2021, 05:57:00 PM by ToxicFrog »

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #6 on: February 25, 2021, 06:43:10 PM »
I *THINK* I may have found a workaround.

1. I pulled my prefab into a scene and unpacked it completely.

2. Deleted the original 'cursed' prefab.

3. Modified my unpacked prefab as needed and created a new prefab.

4. Re-pointed the spawner object to the new prefab

I've done this twice now, and it LOOKS LIKE everything is working as intended.

Not a perfect solution, but it seems to work. I'd love to hear if anyone else experiencing this problem would respond if this trick works for them as well!

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: Playmaker changes variables in prefabs [Workaround found]
« Reply #7 on: February 25, 2021, 11:05:19 PM »
I just sent yesterday a sample project to Alex trying to help fix this issue. If you can send another one replicating this in a clean project, I'm sure it would help a ton.

As far as I'm concerned it only happens when you use global variables in the prefab and copy-paste actions or move them in order. It also can happen when you delete an action in the prefab.

Anyways, the more examples the playmaker team has, the better it will be fixed in the next release.

...And I really hope this will be fixed completely. It's the most annoying bug in Playmaker for me.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Playmaker changes variables in prefabs
« Reply #8 on: February 26, 2021, 01:42:23 AM »
No idea if they are related, but I am renaming many actions to make my FSM flow easier to read. I'm going to stop doing that and see if it makes a difference.

What do you mean by renaming actions? In the State Inspector? Or the action scripts?

If you have a project in a broken state can you email it to me with a not about where to look?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Playmaker changes variables in prefabs [Workaround found]
« Reply #9 on: February 26, 2021, 06:22:35 AM »
Hi.
Our project is still using a older version, but when i edit prefabs it also happens to.
But restarting unity after editing a prefab has helped every time so far.

@toxicFrog i would recommend using github (desktop) instead of collab.
I have had several issues with collab and not only playmaker related.

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs [Workaround found]
« Reply #10 on: February 26, 2021, 07:46:20 AM »
As far as I'm concerned it only happens when you use global variables in the prefab and copy-paste actions or move them in order. It also can happen when you delete an action in the prefab.


I don't have any global variables in this project, so I may be Patient Zero for the Cursed Prefab bug with no globals! :)

That's interesting about copy/paste/move/delete being a suspect. I will keep an eye on my procedures in the future and see if I can pinpoint a moment at which the curse appears.

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs
« Reply #11 on: February 26, 2021, 07:52:02 AM »

What do you mean by renaming actions? In the State Inspector? Or the action scripts?

If you have a project in a broken state can you email it to me with a not about where to look?

I mean renaming the action in the State Inspector (screenshot attached).

I'd like to send you the project for you to evaluate, but this is a project for a client that I am not at liberty to share. I'll see if I can make a make a stripped-down version, but I don't know if that's really possible. The prefab in question is hooked up to about a zillion different things (PUN2, OVR, Dissonance, FinalIK, etc)

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: Playmaker changes variables in prefabs [Workaround found]
« Reply #12 on: February 26, 2021, 08:29:02 AM »
Oh that’s interesting. I rename actions all the time. I will test this as well in my sample project to see if it affects somehow.

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Playmaker changes variables in prefabs [Workaround found]
« Reply #13 on: February 26, 2021, 10:27:23 AM »
Follow-up:

The workaround has been working great so far.

I've unpacked/modified/re-created the prefab several times without issue.

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: Playmaker changes variables in prefabs [Workaround found]
« Reply #14 on: February 27, 2021, 03:12:04 PM »
So I tested beta version 1.9.1.p4 and it seems this problem is fixed. I tried to break it back and fourth yet didn't break once. Will need to try in my main project as well, but looks good right now.

Will have to see if the global variable corruption still happens as pointed out in this thread:
https://hutonggames.com/playmakerforum/index.php?topic=16254