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

Tween script tweens light to 65025, 65025, 65025 for no reason when I put in any color3 value?

So I'm testing about with tweenservice, here's my code.

local TS = game:GetService('TweenService')
local tweenInfo = TweenInfo.new(
	2, -->> Tween time.
	Enum.EasingStyle.Linear, -->> Tween style. 
	Enum.EasingDirection.Out,  -->> Easing direction, don't recommend changing.
	0, -->> How many times the tween repeats, don't recommend changing.
	false, -->> Does the tween reverse? Don't recommend changing.
	 0 -->> How long does it take to tween?
)
local light = script.Parent.Light


script.Parent.ClickDetector.MouseClick:Connect(function()
local partProperties = {
Color = Color3.new(255,255,255)
}
	local Tween = TS:Create(light,tweenInfo,partProperties)	
	Tween:Play()
end)

When I click the part, the light tweens the colour value to a specific number; (65025, 65025, 65025) for no reason, if I enter in another number, for example 255,0,0 it tweens to (65025, 0, 0), etc How do I fix this?

Also, the lights look like this for some reason (I'm using future but I don't think that changes how the lighting engine itself works in a way that I would have to modify my code)

1 answer

✓ Accepted answer

Color3.new takes values from 0 to 1. You might be looking for FromRGB which takes 0 to 255 instead

1 comment

0

Thanks, I had this issue before but it never actually tweened to an insane number, but instead just tweened to 0,0,0

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