Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug [REGRESION] prefab unpacking during play doesn't work properly when a script with RequireComponent

Discussion in '2020.2 Beta' started by laurentlavigne, Oct 13, 2020.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    is deleted in the scene.
    error in console:
    Error removing component when merging Prefab changes: Can't remove CharacterController because ThirdPersonControllerStrafe (Script) depends on it


    major regression, in 2020.1.7 prefab works

    This script was deleted, in fact all the components were but in 2020.2 character controller resurects by magic on play so then the prefab system tries to get rid of it again but that doesn't work because somehow the prefab system runs part of strafe.cs as it's unpacking this prefab
    probably caused by
    [RequireComponent(typeof(CharacterController))]

    upload_2020-10-12_16-48-12.png
    charactercontroller shouldn't be there but it reappears
     
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225