if (counter == 10.0F)
{
light.color = Color.blue;
}
But I want to change ‘light.color’ to a value that I’ve managed to find in the Inspector by dragging the selector around, how would I use the RGB values from this and apply them to the code? I’ve had a look at some documentation and answers and I can’t find anything that will let me do this, it just seems to be ‘Color.whatevercolour’. The RGB value that I want to use is ‘180/63/255’.
It seems like a really basic thing but I’m just having a bit of difficulty from it, I’d really, really appreciate it if anyone can help me do this.
I’m assuming C# from your code snippet. If you already have a colour variable in the Inspector, can you not simply assign the variable to the light colour?
public Color myColour;
void SomeMethod()
{
if (counter == 10.0F)
{
light.color = myColour;
}
}
or using your chosen values :
void SomeMethod()
{
if (counter == 10.0F)
{
float r = 180.0f / 255.0f;
float g = 63.0f / 255.0f;
float b = 255.0f / 255.0f;
light.color = Color( r, g, b );
}
}
Yeah, C#. Thank you!
– kylehloganI did light.color = Red; but it says unknown identifier Red.
– Petomai