- Home /
Color problem
Hi!
I've the following code:
Color myColor = new Color(Random.Range(36, 74), Random.Range(19, 30), Random.Range(19, 30), 255);
childTransform.renderer.material.SetColor("_TintColor", myColor);
It's not working. Color selected is White but, if I use:
childTransform.renderer.material.SetColor("_TintColor", Color.green);
It's working... Can anyone tell my why?
Cheers!
Comment
Best Answer
Answer by Stormizin · May 28, 2013 at 01:49 PM
I think you need to be between 0-1 with Color statement. Each color component is a floating point value with a range from 0 to 1. e.g: new Color(1,0,0.2f,1);