Sindious
(mark)
July 18, 2024, 3:33pm
#1
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?
Sindious
(mark)
July 18, 2024, 3:49pm
#3
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")
Sindious
(mark)
July 19, 2024, 9:07am
#6
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
notsad2
(nots7d)
July 19, 2024, 9:40am
#7
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})
Sindious
(mark)
July 19, 2024, 10:13am
#8
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.
notsad2
(nots7d)
July 19, 2024, 10:21am
#9
doesn’t tween service require easing style and direction?
enpiesie
(enpiesie)
July 19, 2024, 10:33am
#10
it doesn’t, it gets assigned a default value
enpiesie
(enpiesie)
July 19, 2024, 10:37am
#11
mark:
ClockTime = 16,
mark:
Haze = 0.49,
Why do the tables end in commas? wouldn’t this throw an error?
Sindious
(mark)
July 19, 2024, 10:38am
#12
No ending a table in a comma doesn’t make a different to the code.
Exozorcus
(Exozorcus)
July 19, 2024, 11:01am
#13
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?