Answers for "unity change material at runtime"

C#
1

unity change material at runtime

public Material material1;

gameObject.renderer.material = material1;

// Change the Color of the GameObject
material1.color = Color.red;
Posted by: Guest on July-01-2021
0

unity change material at runtime

[SerializeField] Material material;

    void WhenYouWantTheMaterialToChange
    {
        GetComponent<Renderer>().material = material;
    }
Posted by: Guest on September-22-2021

Code answers related to "unity change material at runtime"

C# Answers by Framework

Browse Popular Code Answers by Language