hello, I have a script in which when a key is pressed, a different amount of transparency is supposed to appear. but, in the first amount of transparency that is supposed to happen, it doesnt. and when I change the model inside my for loop, it works perfectly fine. help?
my code:
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(popupsM.Parts.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 3.5, Range = 48})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.2})
tw:Play()
end
end
desired effect:
https://gyazo.com/a18da559d4b80ef9897d6b833751b3f0
current effect:
https://gyazo.com/73e792fcb5c5018c1681f9422441e288