Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity how get random color to material

//using Color32
Color32 randomColor = new Color32(
	 System.Convert.ToByte(Random.Range(0, 255)), //Red
	 System.Convert.ToByte(Random.Range(0, 255)), //Green
	 System.Convert.ToByte(Random.Range(0, 255)), //Blue
	 System.Convert.ToByte(255), //Alpha (transparency)
);
 
PREVIOUS NEXT
Tagged: #unity #random #color #material
ADD COMMENT
Topic
Name
2+9 =