- Home /
Modifying mesh of my instance changes prefab also!
I'm currently experimenting with procedural meshes.
My starting block was created with a prefab. When I add more blocks (using the same prefab) and then combine the meshes of these blocks, the Prefab itself is changed by this also.
Is there a way to either modify/replace an instance mesh without changing the mesh of it's prefab or can I programatically detach an instance from its prefab so I can make modifications without impact on the prefabs?
I did see posts that mention "how to disconnect from prefab", but doing it through the editor menu or via UnityEditor.PrefabUtility.DisconnectPrefabInstance is not an option, since I need to be able to call it during level creation (dynamically at runtime) and not just while I'm in the editor.
Answer by NoseKills · Apr 11, 2017 at 04:52 AM
If my memory serves me right, you can just get a reference to the Mesh, Instantiate it and replace the MeshFilter.mesh or .sharedMesh with the instantiated one in Start/Awake
Your answer
Follow this Question
Related Questions
Instantiate Prefab in another Prefab 0 Answers
Instantiate buttons , each with a unique positioning 2 Answers
How to instantiate random object in a panel ? 2 Answers
Destroy() not working on prefab instance 2 Answers
transform.Translate code isn't working 0 Answers