Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

1 answer

✓ Accepted answer

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();
    

This discussion is preserved as it was. New answers, comments, and votes are closed.