playMaker

Author Topic: Variable Changes When Modding Prefab (FIXED)  (Read 388 times)

ch1ky3n

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Variable Changes When Modding Prefab (FIXED)
« on: May 02, 2021, 11:21:16 AM »
1. Make a Prefab contains many children (Used for referencing)
2. Make an FSM that trying to manipulate those children
3. Add a couple of scripts to modify the scale/transform/Sprite renderer color
4. Cache some of the children's objects and drag some of them into the action's gameObject field directly.
5. Drag the prefab into the scene 5-6 times
6. Then modify the original prefab by adding some actions/deleting some
7. Try to do this couple of time
8. After a while, check the instantiated prefab (#5)
9. Somehow, It replaces those direct references to some cached variable and vice versa.
10. Removing the scene prefabs and replace them with the original prefab solves the problem

In the screenshot below, I just add new action inside the original prefab
then when I check the scene prefab
the variable changes from objParentBrick > ObjMonitor.

EDIT: I only test the GameObject variable. Make sure to go to PlayMode at least once to see the bug changes the variable
« Last Edit: July 16, 2021, 02:52:50 AM by ch1ky3n »

ch1ky3n

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Re: Variable Changes When Modding Prefab
« Reply #1 on: May 03, 2021, 09:52:12 AM »
I can confirm that it also happens in regular FSM (Non-Prefab) when you try to change the variable type from game object to string. At least, that what happened to me. All the variables in the actions are replaced with variable below them (On the variable list) them.

a is replaced by b
b is replaced by c
c is replaced by d
etc
« Last Edit: May 03, 2021, 09:54:29 AM by ch1ky3n »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6398
    • View Profile
    • jinxtergames
Re: Variable Changes When Modding Prefab
« Reply #2 on: May 03, 2021, 10:10:39 AM »
Hi.
Which Unity/Playmaker version?
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

ch1ky3n

  • Full Member
  • ***
  • Posts: 195
    • View Profile
Re: Variable Changes When Modding Prefab
« Reply #3 on: May 03, 2021, 09:54:40 PM »
New update today, contains fixed variable changes when editing prefab.
Yay!