New answers tagged

0

If you want to use the Setter, you need to use the correct name of the color that is assigned. void Start() { rend = GetComponent<Renderer>(); rend.material.SetColor("_Color", colorToTurnTo); } You can find the name of it when you follow the rend.material.color (which you can set directly as DMGregory posted) and it calls the ...


1

You are changing a material property called "_SpecColor" that the default sprite material does not use. Did you mean to change the colour of the sprite renderer itself? This is more efficient than cloning the material to set unique material properties on the instance. void Start() { rend = GetComponent<SpriteRenderer>(); rend.color = ...


0

I'm not aware of the Color.HSVToRGB method in Unity. using Color activeColour2 = Color.HSVToRGB(DateTime.Now.Millisecond*0.001f,1,1) give the desired result since the conversion is a linear relationship with respect to time.


Top 50 recent answers are included