Tween not playing

A simple sounding issue yet confusing my two tweens will not play and I dont know why… They just tween a lot of properties within lighting

local TweenLighting = TWEEN_SERVICE:Create(LIGHTING, TweenInfo.new(15), LIGHTING_HANDLER.NightTimeLighting); TweenLighting:Play()
local TweenAtmosphere = TWEEN_SERVICE:Create(LIGHTING.Atmosphere, TweenInfo.new(15), LIGHTING_HANDLER.NightTimeAtmosphere); TweenAtmosphere:Play()
lighting.NightTimeLighting = {
	Ambient = Color3.fromRGB(98, 72, 72),
	Brightness = 2.9,
	ColorShift_Top = Color3.fromRGB(0, 0, 0),
	ColorShift_Bottom = Color3.fromRGB(0, 0, 0),
	EnvironmentDiffuseScale = 1,
	EnvironmentSpecularScale = 0.439,
	OutdoorAmbient = Color3.fromRGB(122, 86, 107),
	ClockTime = 16,
}

lighting.NightTimeAtmosphere = {
	Density = 0.195,
	Offset = 0,
	Color = Color3.fromRGB(255, 255, 244),
	Decay = Color3.fromRGB(135, 135, 135),
	Glare = 3.17,
	Haze = 0.49,
}
2 Likes

is LIGHTING_HANDLER referencing thesame table as lighting?

Lighting handler is a module which is required

i tested thesame code in a test place and it seems to be working fine so its probably some issue with referencing

It seems you don’t have TWEEN_SERVICE defined. Try adding this to the start of the code:

TWEEN_SERVICE = game:GetService("TweenService")
local TWEEN_SERVICE = game:GetService("TweenService")
local LIGHTING = game:GetService("Lighting")
local LIGHTING_HANDLER = require(script.LightingHandler); LIGHTING_HANDLER.LobbyLighting() -- when the player joins this will be the lighting

referencing is fine

you’re missing EasingStyle and EasingDirection in TweenInfo.new()

along side that, you put the destination in {}

TWEEN_SERVICE:Create(LIGHTING, TweenInfo.new(15, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {LIGHTING_HANDLER.NightTimeLighting})

I don’t need to provide the rest of the tweeninfo arguements and LIGHTING_HANDLER.NightTimeLighting is already a table so your code would error.

doesn’t tween service require easing style and direction?

it doesn’t, it gets assigned a default value

Why do the tables end in commas? wouldn’t this throw an error?

No ending a table in a comma doesn’t make a different to the code.

you could try setting a very basic tween like setting ClockTime to a value to make sure that its not an error in your script

if that succeeds, i would check your module scripts

oh, printing the playback state would also be a good idea, if you haven’t already done that

Is there any sort of error in the console?