Why when i change the transparency of a prefab in runtime it change the prefab permanently?!
i change the transparency of color of Sprite Renderer in runtime and it saved the changed transparency after game view on the prefab!!!why?!what can i done to prevent this?
change the transparency on the instance on the game (the instantiated one), not the prefab directly
Answer by Konsicrafter · Mar 25, 2017 at 03:05 PM
All changes you perform on the prefab are permanent, perform changes on the instantiated object of the prefab instead an hit "Apply" if you want to apply the changes to the prefab.
thanks for your response , i actually mean the clones of the prefab ,any change i perform to instantiated objects in runtime are apply to the prefab!why this happening?!
Are you sure that you are using the instance and not the prefab? How do you change the color, via script or in the inspector? If you do it in a script, you could call
Debug.Log(prefabInstance.gameObject.name);
to make sure it has "(Clone)" in its name.
Your answer
![](https://koobas.hobune.stream/wayback/20220612113925im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
LookAt method not working on instantiated objects. 1 Answer
Logic behind multiple copies of a prefab? 2 Answers
Use FPSController/FirstPersonCharacter to Rotate a scene with a Joystick 0 Answers
How to Destroy a prefab avoid to destroying assets is not permitted to avoid data loss problem 1 Answer
How do I Instantiate a prefab at the x axis position of where the UI button was clicked 1 Answer