Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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:
    5,999
    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:
    5,999