Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Request: Allow prefabs to be "locked" (prevent any modifications in scene instances)

Discussion in 'Prefabs' started by PhilSA, Sep 6, 2019.

  1. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I'm not sure if this is already possible or not, but here's a problem I always run into when working in teams:
    1. Someone makes a prefab of something. Let's say it's an enemy prefab
    2. The prefab is put in several places in scenes
    3. [time passes as development continues]
    4. One day you see one of these enemy prefab instances in the scene has unapplied modifications to it. Now you're wondering:
      1. Was it intentionally modified for that specific instance?
      2. Was it intended to be for the prefab in general but someone forgot to apply it?
      3. Was it intended to be just a test that some designer did but they forgot to revert it?
      4. etc....
    In my opinion, the best solution to this very common issue is to give us an option to "lock" prefabs. Meaning the only place where you'd be allowed to modify their properties is in the prefab window; not in the scene instances. For the latter, properties would be visible but greyed out. Or maybe just not visible at all if that's too complicated

    My preferred way of working with instance-specific properties on prefabs is to use property-setter scripts in the scene, or spawner scripts that instantiate the prefab and sets the specific data on it. This way you avoid all the risks and trouble of unapplied properties. But still, sometimes there are cases where prefabs will end up being put directly in scenes. And in those cases, it would be very useful to make it impossible to modify them. You can never really count on just asking people to be careful about it

    Is this something that could be done?
     
    Last edited: Sep 6, 2019
    Server12, JesOb and JoNax97 like this.
  2. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,105
    I think we can do this by our selves but have out of the box will be very useful.

    Waiting this future along with prefab exposed properties right from nested prefab release