Trodgy
(troogilydoogily)
June 22, 2020, 7:23am
#1
Me again aaaaaa
Ok so like I’m currently trying to get a bit of a fog system running, right? I am able to change the fog to some settings, however attempting to change it back to it’s default settings ends up with it just making the screen turn completely white.
Keep it in mind that the view is locked into first person.
Unlike my last issue, there isn’t any error message to base this off of, just the code itself.
local TweenS = game:GetService("TweenService")
local Lighting = game.Lighting
local TweenInf = TweenInfo.new(0.05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Finish = {FogStart=0, FogEnd=100000,FogColor=Color3.new(192, 192, 192)}
local FogTween = TweenS:Create(Lighting, TweenInf, Finish)
So, any ideas on what caused the issue? My assumption is that it has something to do with the Finish variable, but I’m not too sure.
1 Like
Seoarro
(seo)
June 22, 2020, 7:34am
#2
I think you should use a repeat until
loop. Like this:
local lighting = game:GetService("Lighting")
repeat
lighting.FogEnd = lighting.FogEnd - 1
until lighting.FogEnd == 500
Trodgy
(troogilydoogily)
June 22, 2020, 7:39am
#3
oh my bad I put the wrong code lol
For the most part, your code looks alright as long as you have played FogTween
. If you haven’t, you can just add FogTween:Play()
on the next line.
Trodgy
(troogilydoogily)
June 22, 2020, 7:40am
#5
oh yeah it plays FogTween right after the info is given.
1 Like
Trodgy
(troogilydoogily)
June 22, 2020, 7:41am
#6
yeah my bad the actual issue comes from the line
local Finish = {FogStart=0, FogEnd=100000,FogColor=Color3.new(192, 192, 192)}
but how to fix the issue is the question.
1 Like
I just tried using the FogColor
you entered in the Finish
variable, change Color3.new
to Color3.fromRGB
.
aka:
local Finish = {
FogStart = 0,
FogEnd = 100_000,
FogColor = Color3.fromRGB(192, 192, 192)
}
2 Likes
Trodgy
(troogilydoogily)
June 22, 2020, 7:43am
#8
o h
I am stupid and also maybe ever so slightly dumb for forgetting that you have to do Color3.fromRGB
1 Like
Trodgy
(troogilydoogily)
June 22, 2020, 7:44am
#9
yep, problem solved. thanks for the help lol
2 Likes