Cosnez
(Cosnez)
December 4, 2021, 2:38am
#1
Hello, I’m trying to make it where fog tweens but it doesnt work, any help
local TS = game:GetService("TweenService")
local FadeInFog = TS:Create(game.Lighting.FogEnd, TweenInfo.new(0.7, Enum.EasingStyle.Linear), {FogEnd = 50})
local FadeOutFog = TS:Create(game.Lighting.FogEnd, TweenInfo.new(0.7, Enum.EasingStyle.Linear), {FogEnd = 111111111})
1 Like
You need to call :Play()
on the variables like FadeInFog:Play()
1 Like
Cosnez
(Cosnez)
December 4, 2021, 2:46am
#3
i know but it said an error with cant cast value, and when i type FadeInFog it doesnt give me a autocorrect for Play or stop meaning its wrong
7z99
(cody)
December 4, 2021, 2:49am
#4
That’s because you’re passing Lighting’s .FogEnd property for the instance argument, use game.Lighting
instead of game.Lighting.FogEnd
.
You also have to call :Play() on it as @Lorourkethebest said but you might be playing it later in the script.
1 Like
It doesn’t need to give autocorrect for play. When I try to play a sound from the Workspace, for example, it doesn’t autocorrect, I just have to type Play(). That’s how it is for sounds, so unless your trying to “Play()” the wrong thing, I honestly have no idea.
Forummer
(Forummer)
December 4, 2021, 11:26am
#6
local TS = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")
local FadeInFog = TS:Create(Lighting, TweenInfo.new(0.7, Enum.EasingStyle.Linear), {FogEnd = 50})
local FadeOutFog = TS:Create(Lighting, TweenInfo.new(0.7, Enum.EasingStyle.Linear), {FogEnd = 111111111})
task.wait(3)
FadeInFog:Play()
FadeInFog.Completed:Wait()
FadeOutFog:Play()
FadeOutFog.Completed:Wait()
print("Both tweens played!")