I want to make a Menu with a camera. I went through many issues and someone gave me a recommendation to fix one of them, after I used that, my UI disappeared. No errors, nothing. I’m not sure what to do.
Here’s the code.
local camera = workspace.CurrentCamera
local cameraPos = workspace:WaitForChild("MenuCamera")
local playBtn = script.Parent.PlayBtn
local Title = script.Parent.Title
local MMTheme = game.Workspace.Sounds.MainMenuTheme
local MainTheme = game.Workspace.Sounds.BGMusic
local fader = script.Parent.Fade
local plr = game.Players.LocalPlayer
local cameratype = Enum.CameraType.Scriptable
local cf = cameraPos.CFrame
wait(.001)
game.StarterGui.ScreenPlay.PlayBtn.Visible = true
game.StarterGui.ScreenPlay.Title.Visible = true
MainTheme.Playing = false
MainTheme.Looped = false
MMTheme.Playing = true
MMTheme.Looped = true
camera.CameraType = cameratype
camera.CFrame = cf
local Conn = camera:GetPropertyChangedSignal("CameraType"):Connect(function()
if not (camera.CameraType == cameratype) then
camera.CameraType = cameratype
camera.CFrame = cf
end
end)
camera.CameraSubject = cameraPos
camera.FieldOfView = 50
playBtn.MouseButton1Click:Connect(function()
game.Workspace["Menu Map"]:Destroy()
game:GetService("TweenService"):Create(fader, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
task.wait(.01)
game:GetService("TweenService"):Create(fader, TweenInfo.new(0.2), {BackgroundTransparency = 0}):Play()
wait(0.5)
game:GetService("TweenService"):Create(fader, TweenInfo.new(0.2), {BackgroundTransparency = 0}):Play()
task.wait(.01)
game:GetService("TweenService"):Create(fader, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
local char = plr.Character or plr.CharacterAdded:Wait()
Conn:Disconnect() -- disconnect the function
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = char.Humanoid
MMTheme.Playing = false
MainTheme.Playing = true
MainTheme.Looped = true
playBtn.Visible = false
Title.Visible = false
end)
Here’s what it looks like. The UI visibility is true, everything is visible and enabled, it just doesn’t show.
Please help me, thank you so much.