Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Problems with Lighting values?

I still have yet to figure out this problem, I guess I don't understand how the values work, but when attempting to set the OutdoorAmbient's color3 back to (127, 127, 127) I get the same large integer in r, g, and b:

--I first set the values to this:
lighting.OutdoorAmbient = Color3.new(0,0,0)

--then, after some stuff happens I set it to this
lighting.OutdoorAmbient = Color3.new(127,127,127)

-- the value I receive after said stuff happens
[32385, 32385, 32385]

so, why does this happen, how do I avoid it?

1 answer

✓ Accepted answer

Why do I get 32385?

The reason for this is because 127, which is the value you provided, multiplied by 255 is 32385.

Why, and how do I fix this?

Color3.new takes in a decimal. To get the values you want, simply divide 127 by 255.

--I first set the values to this:
lighting.OutdoorAmbient = Color3.new(0,0,0)

--then, after some stuff happens I set it to this
lighting.OutdoorAmbient = Color3.new(127/255,127/255,127/255)
If I helped, please don't forget to accept my answer.

2 comments

0

Or use Color.fromRGB

0

Yeah. I don't have access to the wiki currently, and I wasn't sure on the name of that function.

This discussion is preserved as it was. New answers, comments, and votes are closed.