Simple fade from and to black

I’m on version 50 attempt of this … Tried everything I could think of. Why I posted here. Maybe someone knows a work around.

This is a preset black GUI with this code.

drp = script.Parent.drop
function Drop(mode)
	if mode then drp.BackgroundTransparency = 0
		
		repeat task.wait(0.02)
			drp.BackgroundTransparency += 0.1
		until(drp.BackgroundTransparency >=1)
		drp.BackgroundTransparency = 1
		
	else drp.BackgroundTransparency = 1
		
		repeat task.wait(0.02)
			drp.BackgroundTransparency -= 0.1
		until(drp.BackgroundTransparency <=0)
		drp.BackgroundTransparency = 0
		
	end
end task.wait(1)
Drop(true)

plr = game.Players.LocalPlayer
chr = plr.Character or plr.CharacterAdded:Wait()
chr:WaitForChild("Humanoid").Died:Connect(function()
	Drop(false)		
end)

How you going to get any faster than that. It should come up black.
“drop” is just a frame.

I need the moment of blackness … because I’m changing the players outfit and accessories. Without a covered up screen for just a second you can see it change and it looks tacky.

But without anything but just this GUI it still will screen flash if the connect is slower than normal.
fade.rbxm (3.7 KB)

Publish this and check for yourself …

Literally just wait for the black screen then change the avatar items. You can simulate a loading screen and it wont make much of a difference

1 Like

That is where I’m at now … and from time to time on the slower loads I get a tacky screen flash.
Be nice if the camera had a color level like how decals work. The fade in and out could easily be done from that no GUI needed.

1 Like

I found a solution!

Place a LocalScript Into ReplicatedFirst And Copy The Following Code Into It:

local Lighting = game:GetService("Lighting")

local ColorCorrection = Instance.new("ColorCorrectionEffect", Lighting)
ColorCorrection.Brightness = -1

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
ScreenGui.IgnoreGuiInset = true
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = Player.PlayerGui
Frame.Size = UDim2.fromScale(1, 1)
Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
Frame.Parent = ScreenGui

ColorCorrection.Brightness = 0
ColorCorrection:Destroy()
TweenService:Create(Frame, TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()

Humanoid.Died:Connect(function()
	
	Frame.BackgroundTransparency = 1
	local FadeInTween = TweenService:Create(Frame, TweenInfo.new(Players.RespawnTime + 2, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = 0})
	FadeInTween:Play()
	FadeInTween.Completed:Connect(function()
		
		ScreenGui.Parent = ReplicatedStorage
		ScreenGui.Parent = Player.PlayerGui
		TweenService:Create(Frame, TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
		
	end)
	
end)

Hopefully this works!

This didn’t do anything at all … ?
Even tried it from a new blank program.

im gonna try executing the code via a “RemoteEvent” hopefully that works.

You did give me an ideal however … the lighting has a Lighting.ExposureCompensation
For what I’m doing that is as good as a camera color settings.

You could also try ColorCorrection’s “Brightness” property too, as i don’t know if “ExposureCompensation” completely covers the screen.

I think we got it here … shockingly! Used: Lighting.ExposureCompensation = -100
fade.rbxm (4.3 KB)

Will need more testing but so far it made it on a slow load up.

This works! It still has that “screen flash” from time to time but the ExposureCompensation covers it up like a champ!

note: My real ExposureCompensation is 0.75 and the fade in is trigged from a different script by changing fad.Value to true. This all allows me to change the player gear and accessories unseen.
With a nice fade in and out effect.

local Lighting = game:GetService("Lighting")
Lighting.ExposureCompensation = -100

drp = script.Parent.drop
fad = script.Parent.fade

function Drop(mode)
	if mode then drp.BackgroundTransparency = 0
 	    Lighting.ExposureCompensation = -0.75
		
		repeat task.wait(0.02)
			drp.BackgroundTransparency += 0.1
		until(drp.BackgroundTransparency >=1)
		drp.BackgroundTransparency = 1
		
	else drp.BackgroundTransparency = 1
		
		repeat task.wait(0.02)
			drp.BackgroundTransparency -= 0.1
		until(drp.BackgroundTransparency <=0)
		drp.BackgroundTransparency = 0
		Lighting.ExposureCompensation = -100
	end
end

fad.Changed:Connect(function()
	if fad.Value == true then
		Drop(true)
	end
end)

plr = game.Players.LocalPlayer
chr = plr.Character or plr.CharacterAdded:Wait()
chr:WaitForChild("Humanoid").Died:Connect(function()
	Drop(false)		
end)

I’m going to give you the solution here (for your over and above work). You did give me the ideal also.

glad i could help, hopefully your game succeeds.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.