Search Unity

[Help]What makes Revert Failed?

Discussion in 'Prefabs' started by zIyaGtVm, Jan 5, 2019.

  1. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    I'm using 2018.3 nested prefab workflow. After I click Revert All Button, always find that Nothing has been changed.
    Even after I revert changes one by one and see "No Overrides" the next time I reopen the Overrides drop-down menu , only to find overrides still there.
    GIF.gif
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    The script that keeps appearing as having overrides, does it make some edit-time modifications to the object?
     
  3. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Thanks for your reply.
    The script contains an OnValidate function to change childobjects' localscale.
    Some gameobjects with the same script can override properly.
    Also when I only change Sorting Group component , the override menu will be reset again and again no matter how many times I apply them:confused:
    sorting.png
     
  4. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    If you comment out the OnValidate method, do you still have this issue?

    I tried having just SortingGroup here and changing that and that on its own can be applied fine. I'm fairly sure something in the scripts is modifying your Prefabs after you apply so that they are overridden again.
     
  5. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Sorry I made a mistake ,the script which I was applying didn't contain a OnValidate method.And I have tried commont OnValidate method on another script.Still failed to override .
     
  6. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Then I have no idea and we'd need a bug report to be able to look further into this.
     
  7. jaglitegrann

    jaglitegrann

    Joined:
    Feb 25, 2014
    Posts:
    10
    Have you found any solution to this this problem or any insight of why it is happening?
    I seem to experience the same issue. Fields in the inspector keeps overriding them self even though they just have been reverted.

    In my search to an answer I have been feeling like the issue is related to fields that has references to other gameobjects inside it's prefab.

    In my case the problem has been with an prefab variant. The base prefab has a field in a script that reference a child gameobject. In my prefab variant this value is automatically overridden even though no changes has been made to it and even though I keep revert the value.

    gif showing the problem.
    RevertProblem.gif
     
    Last edited: Jan 30, 2019
  8. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    We have not been able to investigate this issue before now since we never got a bug report and were not able to reproduce it. With this new information we have been able to reproduce the issue and will work on a fix.
     
  9. jaglitegrann

    jaglitegrann

    Joined:
    Feb 25, 2014
    Posts:
    10
    Okey very nice to hear that, thank you for your answer!