Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to create a fade in-out transition effect (gui), if a player touches a part?

Asked by 5 years ago

I want to create an obby with this thing, but i dont know how to make it. Please help heres an example https://www.youtube.com/watch?v=ffrejmGKFnE&feature=youtu.be

0
This fits in a comment, so use comments!!! User#24403 69 — 5y
0
but in a script User#27142 0 — 5y
0
Well that's for you to figure out. farrizbb 465 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Simply take a black image, place it over the entire screen, set it to be invisible, and slowly decrement its transparency when you want to fade-in, or slowly increment it when you want to fade-out.

Instructions: 1. Insert a ScreenGui into the StarterGui if there isn't already one there. 2. Insert a ImageLabel into the ScreenGui. 3. Change the dimensions of the ImageLabel until it covers the entire screen. 4. Set the BackgroundTransparency of the ImageLabel to one. 5. Insert a blank localscript into the ImageLabel and paste the code below into it.

        FADE_SPEED = 1;
        function FadeIn()
        while (script.Parent.ImageTransparency < 1) do
            script.Parent.ImageTransparency = script.Parent.ImageTransparency + FADE_SPEED/30;
            wait(FADE_SPEED/30);
        end
    end

    function FadeOut()
        while (script.Parent.ImageTransparency > 0) do
            script.Parent.ImageTransparency =   script.Parent.ImageTransparency - FADE_SPEED/30;
            wait(FADE_SPEED/30);
        end
    end

    wait(3);
    FadeIn();
    wait(3);
    FadeOut();
Ad

Answer this question