playMaker

Author Topic: [SOLVED] Adding new variables to prefab  (Read 2854 times)

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
[SOLVED] Adding new variables to prefab
« on: January 06, 2019, 06:32:32 PM »
I'm not sure if this is Playmaker problem or Unity's new prefab problem.
 
I have a prefab with a FSM with some inspector variables, then create a prefab variant and add some values to the FSM inspector variables.

I now go back to the original prefab and add some new variables(check inspector )to the FSM. This will cause the variable values to shift and not stick to the actual variable I gave the value to in the first place.
For visual example I have something like this in the variant prefab:
var1  11
var2  22
var3  33

After I add a new variable, to the original prefab, called var0 it ends up like this:
var0  11
var1  22
var2  33
var3  0(no value set)

I have PM 1.9.0p5 and Unity 2018.0.3
« Last Edit: January 15, 2019, 06:57:54 PM by DanielThomas »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Adding new variables to prefab
« Reply #1 on: January 08, 2019, 03:37:56 AM »
Hi,

 you can't add a variable without breaking the prefab, can you confirm that when you added your variable, you add a popup dialog saying it broke the prefab?


Bye,

 Jean

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Adding new variables to prefab
« Reply #2 on: January 08, 2019, 08:36:51 AM »
It's Unity's new prefab system. I add a new variable to the first/parent/original prefab. It's the prefab variants that get the problem I mentioned above.
I don't get any break prefab popup since I edit the prefab, not an instance of it.

I hope that makes it clearer.

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Adding new variables to prefab
« Reply #3 on: January 08, 2019, 07:20:21 PM »
Here is step by step for quick reproduction:
1. Create new object, make it a prefab
2. Make a prefab variant of the prefab
3. Add fsm to original prefab, add 3 float variables: var1, var2, var3 - check inspector for all. Save
4. Open variant prefab and add values to the variables from the inspector. I used value 1, 2, 3. Save
5. Go to original prefab, delete var2 from the fsm (so it's the middle variable in order). Save.
6. Now go back to the prefab variant, notice var3 now actually have "2" as value - which was the value set var2(which we deleted) originally.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Adding new variables to prefab
« Reply #4 on: January 14, 2019, 03:08:58 PM »
There is a new 1.9.0.p7 build in the beta group that should fix this issue.
Let me know if you get a chance to test it...

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Adding new variables to prefab
« Reply #5 on: January 14, 2019, 04:32:51 PM »
Where do I get the patches for 1.9.0? I only have the shared download folder for 1.9.1 betas.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Adding new variables to prefab
« Reply #6 on: January 14, 2019, 06:20:24 PM »
There should be an Older Versions folder.
If you don't see that, follow the link in Beta Forums >> Beta Feedback >> Beta Announcements

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Adding new variables to prefab
« Reply #7 on: January 14, 2019, 06:59:28 PM »
Got it, thanks! I can still reproduce the problem with the steps I mentioned above. Both in my main project and on a new empty project.

Updating in unity(importing the package) I get "Copying file failed" window, the file is Assets/PlayMaker/Editor/sv-SE/PlayMakerEditorResource.resources.dll: Access Denied.
I pressed "cancel" for that file, but the "about window" says I have 1.9.0.p7 though and everything works fine.


Is this related to this?: https://hutonggames.com/playmakerforum/index.php?topic=14489.0
« Last Edit: January 15, 2019, 11:07:02 AM by DanielThomas »

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Adding new variables to prefab
« Reply #8 on: January 15, 2019, 06:57:39 PM »
Update from today seems to solve it, perfect!