I want to subtract the game’s Lighting.Ambient value by 1 with a tween but for some reason, Color3 values don’t allow that??? It’s weird because I’ve seen code that does exactly what I’m trying to do but in a convoluted and un-tween-friendly way. Does anyone have any tips?
Here is the tween I’m trying to use (I know it doesn’t work, do not tell me it won’t work)
local brightnessTween = TweenService:Create(game.Lighting, TweenInfo.new(0.5), {Ambient = Lighting.Ambient - Color3.fromRGB(1,1,1)})
The way a tween works is the stuff in {} is a goal, what the tween should slowly set that value towards. The way you’re trying to incorporate it, is as if its in a loop.
Here’s an example script.
local TweenService = game:GetService("TweenService")
local brightnessTween = TweenService:Create(game.Lighting, TweenInfo.new(0.5), {Ambient = Color3.fromRGB(255,255,255)})
brightnessTween:Play()
There are Plenty of ways, here is one for Example:
local Ambient = Lighting.Ambient -- Gets Color3
local newColor = Color3.fromRGB(Ambient.R-1, Ambient.G-1, Ambient.B-1) -- Modifies Color3
local brightnessTween = TweenService:Create(Lighting, TweenInfo.new(.5), {Ambient = newColor})
-- I basically just Copy Pasted the Tween code from the Guy Above (lol)