I'm trying to fade a black frame where it starts when you load up the game but then fades out, i tried to do this myself and searched on youtube and etc, but couldn't find anything, so can you guys like explain it or even probably give me a code for it? But i'm mainly would like how to do it.
COMMUNITY QUESTION
How to fade a black frame?
1 answer
You would use a for loop for this. The for loop is a way of running a set of code for a defined number of times.
This is the syntax for for loop
for variable = StartingNum, FinishingNum, Increment do
end
##To need to know materials for this piece
For Loop
BackgroundTransparency
This is an example
-- Declaration Section
local BlackFrame = script.Parent --Where your frame is
-- Processing Section
for number = 1, 0, -0.1 do --Declaring a loop
BlackFrame.BackgroundTransparency = number --Changing BlackFrame's Transparency and decreasing it by 0.1 each millisecond.
wait()
end
wait(5) --Waiting for 5 seconds before reverting back to original transparency
for number = 0, 1, 0.1 do
BlackFrame.BackgroundTransparency = number
wait()
end
And that is how you do it. Comment below if you still don't understand it
Have a lovely day of coding
This discussion is preserved as it was. New answers, comments, and votes are closed.
