playMaker

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

Gaz

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
2018 style prefabs and Templates
« on: March 06, 2019, 03: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, 03:25:32 AM by Gaz »

arats

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: 2018 style prefabs and Templates
« Reply #1 on: March 06, 2019, 01: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: 72
    • View Profile
Re: 2018 style prefabs and Templates
« Reply #2 on: March 11, 2019, 09:20:37 AM »
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, 09:25:56 AM by Marc Saubion »

djaydino

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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: 2018 style prefabs and Templates
« Reply #4 on: March 12, 2019, 05: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...