- Home /
Don't destroy material
Hey everyone. I have a C# script for changing materials. The materials are stored in an array of materials. The script has a GameObject variable for the target's renderer. The renderer's material is set to the index of the array in the script. However, when I load a new level, it changes back to the default material. I want the player to change the character's material in one level and keep it the same in the next level. Is there a way to do that? Thanks.
Try saving the object that you change the materials and, when a new level is load, apply theses changes. You need to carry an instance of your script object or use it by a static context.
Your answer
Follow this Question
Related Questions
Changing two different objects renderer colour 1 Answer
renderer.material doesnt work 3 Answers
Access Multiple Renderer Materials? 1 Answer
Load, change material to game object II (not a repeat) 1 Answer
appear/disappear gameobject 3 Answers