playMaker

Author Topic: Template reference inside a prefab loose/inverte reference after building  (Read 3050 times)

Speakbeaver

  • Playmaker Newbie
  • *
  • Posts: 4
Hi !
I've seen a few threads on this same topic but none of them answer what I'm facing.

Following this https://hutonggames.fogbugz.com/default.asp?W1707

I have multiple normal prefab in my scene.
All of theses prefabs contains a gameobject with a FSM template.
This FSM template have several input variables that store some object references present in the same prefab as this FSM, except one.
This last input variable is an object outside of the prefab in the scene.
Knowing that a scene reference can't be stored in a prefab, I place my prefab in the scene and give to the prefab's FSM this scene variable value (the rest of inputs values are link inside the prefab).
The prefab is not instantiated or anything in runtime, it's directly in the scene at all times.


When I build or reopen (not always) the project I loose this scene variable reference, all inputs variables who references object prefab are mark as changed in the scene (bold value). Or worst, sometimes inputs are complitly inverted.   

Did I miss understand something about Prefab/FSM template/Scene ref workflow ? (Btw I can't but this ref scene in a global variable cause it's for a bundle)

Unity : 2021.3
PlayMaker : 1.9.7

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Template reference inside a prefab loose/inverte reference after building
« Reply #1 on: December 24, 2023, 08:19:29 AM »
Hi.
What platform are you building for?

are you using any Get/Set Properties actions?

Speakbeaver

  • Playmaker Newbie
  • *
  • Posts: 4
Hi,

I'm building for Android.
No I don't use Get/Set properties actions to init or use them, I'm assuming I have the right input.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
on the template, do you have the variable exposed and placed the scene object in the variable on the playmaker fsm component? (not in the playmaker window)

Speakbeaver

  • Playmaker Newbie
  • *
  • Posts: 4
Yes I did, and it was by checking theses variables in the scene that I saw that I had lost my ref.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
Did you make changes to the template after using it on those prefabs?

Templates can be quite fragile, and might not get updated correctly.
(not sure if this is still the issue on current version as i am still working with 1.9.0)
to make sure they get updated, i have to go to the object, then on the component i have to collapse/decollapse the 'Controls' and it will update. you will notice that it will set the prefab/scene to dirty (dirty means you have changes and need to save)

Speakbeaver

  • Playmaker Newbie
  • *
  • Posts: 4
Indeed I made modification for debugging my template.
When you speak of 'Controls' you mean Inputs ?

I will be carefull about this update things and if I can identify a workflow to cause this things I will let you know. The real problem is the randomness of this issue...