playMaker

Author Topic: 2018 style prefabs and Templates  (Read 2850 times)

Gaz

  • Playmaker Newbie
  • *
  • Posts: 4
2018 style prefabs and Templates
« on: March 06, 2019, 05:22:59 AM »
I have a prefab with an FSM on that uses a template. Say the FSM has a public GameObject variable called Marker.

IF I edit the template so that Marker is now called Location, the template doesn't update in the prefab. I can hit refresh and it'll update as expected, but it won't save this refresh. If I close the prefab, then open it again, it will have Marker, not Location.

To fix this I have to refresh, and then modify a transform or another value to get the change to save to the prefab.

Unity: 2018.3.2f1
PlayMaker 1.9.0.p7 and p9

I have sumbmitted a bug with the same tile at this post via the PlayMaker/Tools feature.
« Last Edit: March 06, 2019, 05:25:32 AM by Gaz »

arats

  • Playmaker Newbie
  • *
  • Posts: 1
Re: 2018 style prefabs and Templates
« Reply #1 on: March 06, 2019, 03:26:12 PM »
I have a similar problem.

I have a fsm within a prefab, when editing set parent pointing to another object, it seems to work. But when saving the prefab the rest of the copies of the object do not point to any object.

Marc Saubion

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 79
Re: 2018 style prefabs and Templates
« Reply #2 on: March 11, 2019, 12:20:37 PM »
I also have a similar problem.

I tried to add a template on a prefab and get a message telling me this will unpack said prefab.

I don't see why this is happening.

Edit: I solved it using copy paste from a non prefab using my template. That said, can someone from playmaker tel me if this is bad practice or if I avoided a bug? Thanks
« Last Edit: March 11, 2019, 12:25:56 PM by Marc Saubion »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: 2018 style prefabs and Templates
« Reply #3 on: March 12, 2019, 05:53:08 AM »
Hi.
Does the issues still persists on latest PlayMaker version ? (1.9.0p12)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: 2018 style prefabs and Templates
« Reply #4 on: March 12, 2019, 08:53:36 AM »
Certain edits to prefabs will break the connection to instances. This is due to they way Unity stores prefab instance overrides. It basically does a diff between the properties in the instance and the prefab. Normally with a script, the instance has the same set of properties as the prefab. That is not necessarily the case with a PlayMaker FSM. If you fundamentally change the prefab FSM, the instance overrides no longer make any sense and that can create problems. So the safe thing to do is break the connection in those cases.

It might not be necessary to break the connection when switching a prefab FSM to use a template. It is a fundamental change, but the old overrides shouldn’t break anything. I’ll look into this...

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: 2018 style prefabs and Templates
« Reply #5 on: October 31, 2023, 06:12:43 PM »
Well, it might sound outdated but was this issue addressed back then? I'm using 1.9.0p12 with Unity 2021 and experiencing this very problem. Prefabs with FSM templates didn't update when I changed the FSM template. Manual update helps for a short time but with editor restart all prefabs are back to previous versions.
indie developer of multiplayer adult fighting
http://nakedfighter3d.com