playMaker

Author Topic: Unity 2022 - Prefabs ID changed, reference lost  (Read 3921 times)

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Unity 2022 - Prefabs ID changed, reference lost
« on: July 03, 2023, 05:00:36 PM »
So my project is more and more falling apart since I updated to Unity 2022 and the latest Playmaker 1.9.7. Seems it was a mistake to have update both at the same time because I really do not know which one is causing the issues. But there are several, unfortunately as big as I can't continue with development.

1. First problem that appeared is that Playmaker seems to change prefab IDs when exporting a build. It doesn't happen always, which is weird, but I had it now already 5 times. The problem when this happens, Pool Boss, the pooling solution I use, loses reference and gets corrupted.

2. I thought it might be a good idea to go through the Playmaker tools from the menu. So I first clicked "Load All Playmaker Prefabs", then "Update All FSMs in Build" and then "Preprocess All Prefab FSMs". This broke all my FSMs that uses the component Playmaker Controls. It says Missing (Mono Script). I can re-add the script (since it's actually not missing) but obviously all my settings are gone.

3. The same process above in step 2 will change the prefab ID as pointed out in step 1. I guess Playmaker has to do exactly the same steps when I export as it does when I "Preprocess All Prefab FSMs".
« Last Edit: July 10, 2023, 09:10:49 AM by Christoph »

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #1 on: July 03, 2023, 05:06:15 PM »
This is what my version control shows when the prefab ID gets changed:



That list goes on and on, it's almost infinite.

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #2 on: July 03, 2023, 06:23:55 PM »
Also, wanted to add, it's not only PoolBoss losing the reference to the prefab. It's also Playmaker FSMs that lose the direct reference to the prefab or when in a variable those are lost too.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #3 on: July 04, 2023, 08:31:22 AM »
Hi.
Have you updated PoolBoss?

Have you tried to reimport all?

Make sure to have a backup before you do.

Can you revert to pre-update?

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #4 on: July 04, 2023, 11:01:00 AM »
I'm already using the latest Pool Boss, but I'm pretty confident it has actually nothing to do with Pool Boss itself. And yes, I re-imported it all. Did a new Pool Manager from scratch. Same happened again after I did the Playmaker Preprocess Prefabs step.

Why does it change the prefab ID when doing this? And the weird thing is it doesn't do it with all prefabs. Just with a few and I haven't found out if there's a common thing to all those prefabs. Apparently there's not. Because I thought it might be all prefabs that have the Playmaker Controls script attached, but nope, others have that too and their ID doesn't get changed.

And yes, I could revert, even though I have already worked on several things since I changed to Unity 2022 and latest Playmaker. Would be a shame.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #5 on: July 04, 2023, 12:27:46 PM »
Hi.
Do you use/have templates on those prefabs?

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #6 on: July 04, 2023, 08:10:14 PM »
It just happened again and this time not when exporting but actually when changing actions in the prefab. It's a simple splash particle effect that I enable when a bounce happen by the player. I pool those splash effects since I re-use them. The FSM on the prefab is as well very simple: it basically gets the current player position and sets the gameobject accordingly. I activated and deactivated an action and boooom prefab ID gets changed and PoolBoss loses the reference due to it.

This also answers your question: no, I don't have templates on them. It's a simple FSM as described above that is affected. :(

Edit: I realized now that I simply can discard the changes for the affected prefab in github desktop and the ID change of the prefab is reverted. This immediately resolves the problem with Pool Boss as it doesn't lose the reference.

Here's another weird thing: I now applied the exact same changes again in the splash prefab (after the discard), and the ID change didn't happen this time. So similar as to the exports, it not always changes the ID when I make changes in a prefab.
« Last Edit: July 04, 2023, 08:25:02 PM by Christoph »

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #7 on: July 05, 2023, 04:57:49 PM »
Sadly enough, prefab problem still happening in Playmaker v1.9.6. Will have to revert to 1.9.5 to really see if this is Playmaker related or not. What a mess...

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #8 on: July 05, 2023, 08:26:24 PM »
Update: reverted back to Playmaker v1.9.5f3 which is the version I used before and surprisingly, the same problem persist.

This means that Playmaker in general clashes with Unity 2022. At least that's my hypothesis now since before I updated I never had this problem.

Can anyone confirm or deny who uses Unity 2022?

Either way, I will try to revert to latest Unity 2021 LTS to see if the problem persist.

What else should I be looking for?

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: Playmaker 1.9.7 - Unity 2022 - Prefab Problems
« Reply #9 on: July 06, 2023, 02:14:34 PM »
New Update:
Reverted to Unity 2021. Was a bit weird because it changed all my colliders from the prefabs to double the size and had to manually change them back. Otherwise everything working.

And I have already exported twice for iOS and once for Android and no prefab ID changes. I also manipulated several FSMs on prefabs and the same, no prefab ID changes. This is still with Playmaker 1.9.5f3.

This means, the problem seems to be Unity 2022 clashing with Playmaker in general as pointed out in my previous post.

Is it a Unity 2022 bug? or is it a Playmaker bug not being ready for Unity 2022?

MadPropz101

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Unity 2022 - Prefabs ID changed, reference lost
« Reply #10 on: July 11, 2023, 06:59:45 PM »
Hi,

I'm just writing to confirm that I also had this issue, my pooler didn't work properly with Unity 2022. Every time I would Build the project and exit it, the pool manager would have missing references to the prefabs, so when I Build it again the objects would no longer spawn.

I have also reverted to Unity 2021 and now everything works without issue.