Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

set object to random color unity

[RequireComponent(typeof(Renderer))]
public class colorTint : MonoBehaviour
{
    public List<Color> TintColors;
    // Start is called before the first frame update
    void Start()
    {

            Color c = TintColors[Random.Range(0, TintColors.Count)];

            GetComponent<Renderer>().material.color = c;
    }
 
PREVIOUS NEXT
Tagged: #set #object #random #color #unity
ADD COMMENT
Topic
Name
6+5 =