Random Color

I what to get a random color on a cube. the color shold look a bit like the startColor but when i generate color i get the same color every time any ida what to do.

i also what to be abel to do it to many cube at once but it just get the same color this maybe will fix it self when i solve the other problem

5318919--535092--Unity Help 2.png

You’re working in integers, and then you divide it by 255, which is going to make the result 0 - the decimal bits get truncated. Try making your “r”, “g”, and “b” floats, and use “255f” for your numbers, to ensure that it’s doing all math as floats.

Thanks do you have any ida how to make all cubes a difrent color

You do startColor.r twice, when setting the color. Change one to startColor.b

Also, it’s “difference”