- Home /
Apply only a single value to prefab
I have a prefab with several instances in the scene. I modify a value on one of the instances. It becomes bold, telling me that it is unique to that instance and will not be overridden when the prefab changes. Now I can hit the "Apply" button at the top, so that all bold values are applied to the source prefab and re-linked. The problem is, that I have several bold instances values and only want to apply a single one.
How can I apply a single changed value to the prefab? When right-clicking on a property it gives me the option to "Revert value to prefab", which is the opposite of what I want. I want to apply and link a single value.
I guess that functionality is not built in, but could I maybe add it via custom code?
Concrete example: I have several prefabs with circle colliders. Now I want to change the size for all of them. Naturally, I could change it on the prefab in the project folder, but then I wouldn't have a realtime preview. Instead, I would like to take one of the instances, which are in the level at a relevant position and adjust the size there. Then I can copy the value to the prefab. So I thought there should be the functionality of just applying this one change without manually copying.
Answer by Arkaid · Jan 18, 2017 at 12:28 AM
I don't think it's possible from the apply button, but what you can do is modify the prefab itself.
Select the prefab in the project browser, and modify the value you want directly in the inspector. Any instance that hasn't had that value modified will reflect the changes. Of course, values in bold won't change.
Thanks, yea that's the way I'm doing it right now. I've added my concrete example to the original question. In such a case I would like to have the 'live' preview directly on one of the instances, so I can see my changes in the scene and then apply that single change to all. I know I can also copy the prefab from the project into the scene, then make changes and apply, but that involves multiple steps again and might even take long, since the asset must be positioned correctly to get a good preview. I'd much rather just select an existing instance and make my change there without accidentally applying other instanced/bold properties.
Your answer
Follow this Question
Related Questions
How can I create a grid for a Leveleditor? 1 Answer
Why do prefabbed meshes go missing whenever I pull an update from Unity Collab? 0 Answers
Change angle of camera in prefab preview 1 Answer
How Mark Prefab Dirty? 1 Answer
Can I force z position to match prefab when it's dragged onto scene? 1 Answer