Updated OP to better communicate what I’m asking.
Basically, what I want is a prefab where I can specify certain variables or attributes to ignore when updating instances of that prefab.
Imagine I have a prefab for a piranha plant that shoots fireballs (using this as an example to illustrate the problem)
Not all piranha plants will shoot at the same speed, so I have a float variable that determines how fast it shoots. I also have a child object that the level designer positions – it tells the piranha plant where it will be when it’s fully extended out of the tube (different instances might go higher or lower or to the left a bit etc).
The problem comes when updating the prefabs – since the manipulation of prefabs is limited within the Project view, I often have to change an instance of a prefab and then drag it over to overwrite/update it. This resets the default values and positions of child objects.
Any instance of the piranha plant that happened to use the old default fire rate value (unbolded) will be changed to the new default value (whatever was set for the instance that I used to update the prefab with), breaking the levels they were in.
Additionally, the position of the guide object telling the piranha plant where to extend to will be reset for every single instance, which again breaks all the levels they were in.
The only workaround I can think of is to not use child position and instead make it a v3, and then be super diligent about making sure those values are ALWAYS bold to override the default values. With an editor script I could make the vector3 about as easy to manipulate as the child transform I was using before, but having to make sure everything is bold to override the default is still a HUGE hassle (some of these prefabs have several variables that should be unique to that instance).
I figure this sort of thing isn’t entirely uncommon, so I’m hoping someone has suggestions on how to handle this better.
What I’d really like is to be able to specify certain variables or children to be entirely ignored when updating prefabs. So if I set a specific instance’s fireRate float to 2.3, the only way to update it for that instance is to select that specific instance and change it. I obviously don’t want to totally disconnect the entire instance from the prefab though – just certain variables. Is there something like [OverridePrefab] hidden somewhere in the docs? Any other tips?
Original post: