Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Error removing component when merging Prefab changes

Discussion in 'Prefabs' started by LesBloom, Jun 17, 2019.

  1. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    115
    Hello,

    I am getting the following error
    Error removing component when merging Prefab changes: Can't remove Rigidbody because CharacterJoint

    However, I have already removed the CharacterJoint component

    upload_2019-6-17_11-46-44.png

    This error occurs when re-opening the prefab. The editor lets me remove the RigidBody during prefab edit mode. However, when I close the prefab and re-open it, I get the above error and the RigidBody has returned.

    Any help would be appreciated
    Thank you
     
    diesoftgames likes this.
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,852
    It's a bit hard to follow what's going on here. I think we'd need a bug report to be able to look into it.
     
  3. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    115
    Hi, @runevision

    Unfortunately, I don't have a repro anymore. After enough time went by of being stuck, I gave up and unpacked the nested prefab. It's not preferable, but at least it let me continue.
     
  4. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    115
    Hi, @runevision

    I am encountering this issue again. The only thing I can do to get around it is to unpack the prefab; which is quite unfortunate. Here are repro steps

    1) grab this asset from the asset store https://assetstore.unity.com/packages/3d/characters/humanoids/sci-fi-alien-war-veteran-137705

    2) make a prefab variant from the SK_Rhienolph prefab

    3) from within the prefab variant, remove all of the colliders, character joints, and rigigbodies

    4) save your prefab variant

    5) notice the errors

    6) close and then re-open your prefab variant

    7) notice some rigidbodies were added back
     
  5. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,852
  6. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    80
    This seems to be pretty easy to reproduce, I filed a bug report on it. It seems like sometimes RequireComponent gets really confused in prefab variants even when you remove the component that is doing the requiring. I'm not sure exactly what triggers it, but I've reported it.

    It's not super surprising this has slipped through the cracks since I think in most cases prefab variants will tend to get more complex (that is ADD components), rather than less so. But I have several cases where I need to remove components in prefab variants and this just prevents that from happening so you simply can't use variants in those cases.
     
    Xriuk likes this.
  7. Xriuk

    Xriuk

    Joined:
    Aug 10, 2018
    Posts:
    14
    I'm having the exact same issue on my Project but can't replicate it on a new project.
    In my project I'm removing a requiring component on a prefab instance (not asset) and I'm getting this error, which is weird.
    The error prints out when starting the game, and also when I revert the removed component in the instance (not when I remove it, only when I revert it.
    Managed to get the whole log:

    Code (CSharp):
    1. Error removing component when merging Prefab changes: Can't remove TranslatedText (Script) because TranslatedTextDOTweenAnimation (Script) depends on it
    2. 0x00007ff6bbac8c8c (Unity) StackWalker::GetCurrentCallstack
    3. 0x00007ff6bbad1069 (Unity) StackWalker::ShowCallstack
    4. 0x00007ff6bcfa564c (Unity) GetStacktrace
    5. 0x00007ff6be063a93 (Unity) DebugStringToFile
    6. 0x00007ff6bcc303bf (Unity) DestroyRemovedComponents
    7. 0x00007ff6bcc3782c (Unity) MergePrefabChanges
    8. 0x00007ff6bcbe184b (Unity) MergePrefabInternal
    9. 0x00007ff6bcbe08d2 (Unity) MergePrefab
    10. 0x00007ff6bcbe0b0e (Unity) MergePrefabInstance
    11. 0x00007ff6bcbe09ee (Unity) MergePrefabInstance
    12. 0x00007ff6bc3a777d (Unity) PrefabUtilityBindings::SetRemovedComponents
    13. 0x00007ff6bd642880 (Unity) PrefabUtility_CUSTOM_SetRemovedComponents
    14. 0x000001b1227d761d (Mono JIT Code) (wrapper managed-to-native) UnityEditor.PrefabUtility:SetRemovedComponents (UnityEngine.Object,UnityEngine.Component[])
    15. 0x000001b1227d72cb (Mono JIT Code) UnityEditor.PrefabUtility:RemoveRemovedComponentOverride (UnityEngine.Object,UnityEngine.Component)
    16. 0x000001b1227d5a7b (Mono JIT Code) UnityEditor.PrefabUtility:RevertRemovedComponent (UnityEngine.GameObject,UnityEngine.Component,UnityEditor.InteractionMode)
    17. 0x000001b1227d560b (Mono JIT Code) UnityEditor.TargetChoiceHandler:RevertPrefabRemovedComponent (object)
    18. 0x000001b1227d54c5 (Mono JIT Code) UnityEditor.GenericMenu:CatchMenu (object,string[],int)
    19. 0x000001b1227d5396 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object_object_int (object,intptr,intptr,intptr)
    20. 0x00007ffc7132e0c0 (mono-2.0-bdwgc) [mini-runtime.c:2812] mono_jit_runtime_invoke
    21. 0x00007ffc712b2902 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
    22. 0x00007ffc712bb95f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
    23. 0x00007ff6bb945d94 (Unity) scripting_method_invoke
    24. 0x00007ff6bb93e585 (Unity) ScriptingInvocation::Invoke
    25. 0x00007ff6bc42af4a (Unity) CustomPopupMenuInterface::Execute
    26. 0x00007ff6bc3ef32d (Unity) MenuController::ExecuteMenuItem
    27. 0x00007ff6bcfd1cf4 (Unity) ShowDelayedContextMenu
    28. 0x00007ff6bcfe7866 (Unity) GUIView::OnInputEvent
    29. 0x00007ff6bc564d98 (Unity) GUIView::ProcessInputEvent
    30. 0x00007ff6bcfde755 (Unity) GUIView::DoPaint
    31. 0x00007ff6bcfea9ad (Unity) GUIView::RepaintAll
    32. 0x00007ff6bc64c7ce (Unity) Application::TickTimer
    33. 0x00007ff6bcfaee21 (Unity) MainMessageLoop
    34. 0x00007ff6bcfb2eb1 (Unity) WinMain
    35. 0x00007ff6bedf8256 (Unity) __scrt_common_main_seh
    36. 0x00007ffcefa47034 (KERNEL32) BaseThreadInitThunk
    37. 0x00007ffcf1922651 (ntdll) RtlUserThreadStart
     
  8. Xriuk

    Xriuk

    Joined:
    Aug 10, 2018
    Posts:
    14
    Wow, apparently this error resolved itself after other team members committed stuff overnight. Still can't figure out what could have been the case and how it got resolved...
     
  9. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    480
    Sometimes data in the library is corrupted enough te create small bugs but not enough to prevent the game to run. Changed assets can force a refresh and solve the issue.
     
    Xriuk likes this.
  10. Xriuk

    Xriuk

    Joined:
    Aug 10, 2018
    Posts:
    14
    Ok, the error popped up again, do you know how can I force the library to update manually?
     
  11. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    480
    Yeah. Close Unity, open the library folder in your project, delete everything et reopen your project. It will rebuild everything.
     
    Xriuk likes this.
  12. Xriuk

    Xriuk

    Joined:
    Aug 10, 2018
    Posts:
    14
    Ok, that solved it... at least until it reappeared again. Still don't know what is causing the error
     
    Marc-Saubion likes this.
unityunity