playMaker

Author Topic: Strange 'Apply to Prefab' behaviour  (Read 2901 times)

FlapFail

  • Playmaker Newbie
  • *
  • Posts: 15
Strange 'Apply to Prefab' behaviour
« on: July 30, 2012, 04:24:32 AM »
Hi,

recently I got a new problem with applying changes to my prefabs.
I made a simple box with a FSM on it. It has got 20 states or so. If I just drag one state to another place and hit Apply in the Unity inspector, it is at this particular place on every instance of the box prefab. Works fine! (EDIT: I just realized that this is not working! I moved a state on my Box_Blank instance and hit apply. 2-3 instances did not get this change... what is this??)
The problem is, that in one state is a SendEvent action where I changed the GameObject property to Specify Game Object and selected a GameObject var of the FSM. The problem now is, I've got 4 GameObject vars in this FSM and now I want to change the var on every instance of my prefab. Currently all boxes have the 'drag_manager' gameobject var selected (screenshots..) If I select a different variable (in my case the 'host_gadget') and hit Apply, it only apply's it on this instance. All other instances still have the old variable selected in this SendEvent action.

Why? I mean, the Apply to Prefab button works fine, if I drag around some states, it does it on every instance.

In my hierarchy there is a parent GO with all my boxes as children (the parent is no prefab), if I select any box and change something and hit the Apply button it somehow changes the place in this box parent, is that normal? (first to screenshots in the attachment)
It's like that since the last unity update.

EDIT: I also had the problem that I had a bool variable on a prefab instance FSM that was visible in the inspector. If a changed this to true instead of false and hit play, it just changed back to false again. Any other instance of the same prefab sometimes kept a change to this bool and sometimes not. I had to try it several times until this instance took my changes. (I tripple checked the fact that there is no 'Set FSM Bool' or any similar action that could have changed my bool)

Something is really going wrong with my unity in the last time.. I cannot work like this :D

PS: I'm on the latest Playmaker 1.4.3 and Unity (free) 3.5.3f3
« Last Edit: July 30, 2012, 04:38:07 AM by FlapFail »

FlapFail

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Strange 'Apply to Prefab' behaviour
« Reply #1 on: July 31, 2012, 10:03:50 AM »
I found out something new...

I created an empty scene with a instance of my box prefab.
I assigned the GameObject FSM var in the inspector and hit play. Right after the game has startet, the FSM resets my inspector var to the default (in this case none, like in my prefab). The same happens if I change any other var that is in the inspector. It gets reseted to the prefab value.

I found out that if I make any changes to one of the FSM's in this particular go and hit play, nothing will be resettet, everything is like it should and any modified var stays modified.

Could it be that Unity is not compiling the FSM's unless there are any changes?


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Strange 'Apply to Prefab' behaviour
« Reply #2 on: July 31, 2012, 06:35:16 PM »
There is probably a missing SetDirty somewhere in the editor. Can you file these as bugs (Main Menu > PlayMaker >  Submit Bug Report). I will try to repro here. If I can't I might ask you for some small repro scenes...

FlapFail

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Strange 'Apply to Prefab' behaviour
« Reply #3 on: August 01, 2012, 02:46:36 AM »
Yes this sounds exactly like this!
I will file the bug, thanks.