Weird lighting glitch

for count = 1, 20, 1 do
				colorCorrection.Brightness = colorCorrection.Brightness + 0.1
				wait(0.1)
			end
			wait(2)
			rootpart.Position = shkolatel.Position
			for count = 1, 20, 1 do
				colorCorrection.Brightness = colorCorrection.Brightness - 0.1
				wait(0.1)
			end
			atm.Color = Color3.new(255, 246, 208)```
So my script should make a smooth transition and in the end the color of atmosphere should change to kind of a white color. How do i fix this? The vid is in the comments
3 Likes

robloxapp-20240206-1410563.wmv (911.6 KB)

and atmosphere color should look like this

2 Likes

The script you’ve provided is intended to adjust the brightness of a ColorCorrectionEffect over time and then change the position of a rootpart to that of shkolatel. After another delay, it reverses the brightness change and then sets the Color property of an Atmosphere object.

However, there’s an issue with the way you’re setting the Color for the atmosphere. In Roblox, Color3.new() expects values between 0 and 1 for each color channel, not 255. When you use 255, it’s likely clamping the values to 1, which would result in a full white color.

Here’s how you can fix the color setting part of your script:

atm.Color = Color3.fromRGB(255, 246, 208)

This uses Color3.fromRGB(), which correctly takes values from 0 to 255 for each channel and converts them into the Color3 format that Roblox expects.

Now, let’s consider the full script with this fix and some other improvements:

local colorCorrection = --[[ path to your ColorCorrectionEffect ]]
local rootpart = --[[ path to your rootpart ]]
local shkolatel = --[[ path to your shkolatel ]]
local atm = --[[ path to your Atmosphere ]]

-- Increase brightness smoothly
for count = 1, 20 do
	colorCorrection.Brightness = colorCorrection.Brightness + 0.05
	wait(0.1)
end
wait(2)

-- Teleport rootpart
rootpart.Position = shkolatel.Position

-- Decrease brightness smoothly
for count = 1, 20 do
	colorCorrection.Brightness = colorCorrection.Brightness - 0.05
	wait(0.1)
end

-- Set atmosphere color to a warm white
atm.Color = Color3.fromRGB(255, 246, 208)

Gazoontite, Kasim

2 Likes

Yo, thank you so much for helping me out :slight_smile:

1 Like