Tween Lighting Easyily?

Is there a way to tween this easily?

Lighting.Ambient = Color3.fromRGB(255, 0, 0)
Lighting.OutdoorAmbient = Color3.fromRGB(255, 0, 0)
Lighting.ColorShift_Top = Color3.fromRGB(255, 0, 0)
Lighting.ColorShift_Bottom = Color3.fromRGB(255, 0, 0)
Lighting.EnvironmentDiffuseScale = 0
Lighting.EnvironmentSpecularScale = 0
task.wait(1.5)
Lighting.Ambient = Color3.fromRGB(70, 70, 70)
Lighting.OutdoorAmbient = Color3.fromRGB(70, 70, 70)
Lighting.ColorShift_Top = Color3.fromRGB(0, 0, 0)
Lighting.ColorShift_Bottom = Color3.fromRGB(0, 0, 0)
Lighting.EnvironmentDiffuseScale = 1
Lighting.EnvironmentSpecularScale = 1

If yes how?

you can use the tween service

Of course! Just plug it all into a tween, its that simple

-- Get tween service
local tweenService = game:GetService('TweenService')
local Lighting = game.Lighting

-- Start with default values
Lighting.Ambient = Color3.fromRGB(255, 0, 0)
Lighting.OutdoorAmbient = Color3.fromRGB(255, 0, 0)
Lighting.ColorShift_Top = Color3.fromRGB(255, 0, 0)
Lighting.ColorShift_Bottom = Color3.fromRGB(255, 0, 0)
Lighting.EnvironmentDiffuseScale = 0
Lighting.EnvironmentSpecularScale = 0


-- This is what we want to happen during/after tween
local tweenValues = {
Ambient = Color3.fromRGB(70, 70, 70)
OutdoorAmbient = Color3.fromRGB(70, 70, 70)
ColorShift_Top = Color3.fromRGB(0, 0, 0)
ColorShift_Bottom = Color3.fromRGB(0, 0, 0)
EnvironmentDiffuseScale = 1
EnvironmentSpecularScale = 1
}

-- Create tween info
local tweenInfo = TweenInfo.new(1.5) -- Change 1.5 to however long you want the tween to take

-- Create tween
local tween =  tweenService:Create(Lighting, tweenInfo, tweenValues)
tween:Play() -- Play tween

This should work, but I haven’t tested it yet. Hope it helps! :smiley:

2 Likes

you should use tween service

Use this post to help: How would I make these lighting settings tween?

tysm this really helped (you just forgot to put a , behind the values and a () at the tween:Play) but everything else was perfect ty :slight_smile:

Wow I am really surprised it worked first try :smiley:
Glad it helped.

Also, sorry for asking, but if it was the solution you were looking for, could you mark it as solution? It helps other people find answers for the same problem you had :slight_smile:

Edit: thanks for catching the mistake, I’ll fix it

oh yea sure nearly forgot that! :+1:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.