Quantcast
Viewing all articles
Browse latest Browse all 103

Unity: How can you make a prefab immutable for instance overrides

How can I make a component not result in an instance override generation like the alignment components (Position, Rotation, Width, Height)? Is there a hidden attribute that is applied to the Transform class parameters that results in this? I also read about immutable prefabs. How can I make my prefab immutable? Here is my situation: I am creating prefabs of game objects with a collider and a sprite renderer attached to it. There are 3 predefined sizes with colors. So I create 3 prefabs. The problem is that there is a script that needs to be configured from the editor for each instance. So if I place the items in the scene and then by mistake apply the overrides the prefab values will change which is not desired behavior.

Viewing all articles
Browse latest Browse all 103

Trending Articles