So I'm working on a UI that when you press the play button, it fades out and disables the camera manipulation. That part works except the fade part. Instead of fading, it just becomes slightly opaque and never fades. Here's my code:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local PlayButton = script.Parent
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame
PlayButton.MouseButton1Click:Connect(function()
for i = 1,100 do
Player.PlayerGui.Fade.Blackness.BackgroundTransparency = script.Parent.BackgroundTransparency + 0.01
wait()
end
wait(3)
for i = 1,100 do
Player.PlayerGui.Fade.Blackness.BackgroundTransparency = script.Parent.BackgroundTransparency + 0.01
wait()
end
Camera.CameraType = Enum.CameraType.Custom
PlayButton.Parent.Parent.Enabled = false
game.Workspace.Sounds.Menu:Stop()
end)

1 comment
i realized that at line 14 and 19 they both had plus icons, i changed it and tried your solution and it still didn't work