Title screen only works in studio?

Hello developers.
During the development of my game, I realized that the title screen I made only works in Roblox studio for some reason. When I go into the actual game on the platform, it does not appear initially. Is there anything I’d need to change? I do not know what examples I’d need to provide… Any help is appreciated

Thank you in advance

A script could help :thinking:

Can you show the script for your GUI?

--Music and Menu Handler

local frame = script.Parent
local blur = game.Lighting.DepthOfField
local playButton = script.Parent.PlayButton
local ambience = script.Parent.Ambience
local wind = script.Parent.Ambience2

if frame.Visible == true then
	blur.Enabled = true 
end

if frame.Visible == true then
	ambience:Play()
	wind:Play()
end

playButton.MouseButton1Click:Connect(function()
	frame:Destroy()
end)

playButton.MouseButton1Click:Connect(function()
	ambience:Stop()
	wind:Stop()
end)

playButton.MouseButton1Click:Connect(function()
	blur.Enabled = false
end)

--Menu Camera

local camera = game.Workspace.Camera
local menuCamera = game.Workspace.MenuCamera

repeat wait()
	camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = menuCamera.CFrame

playButton.MouseButton1Click:Connect(function()
	camera.CameraType = Enum.CameraType.Custom
end)

-- Credits Gui

local creditsButton = script.Parent.CreditsButton
local creditsFrame = script.Parent.CreditsFrame

creditsFrame.Visible = false

creditsButton.MouseButton1Click:Connect(function()
	if creditsFrame.Visible == false then 
		script.Parent.CreditsFrame.Visible = true
	else
		script.Parent.CreditsFrame.Visible = false
	end
end)

This is the script for my title screen. I do not know why it only works in studio and not in the actual game. I am relatively new to scripting so I may not spot them on my first look-through

This, could be why

You’re only getting the server’s camera from the client side, when you should be getting the CurrentCamera which would be a property of the workspace, and able to manipulate the camera that way

local camera = workspace.CurrentCamera

this did not work. I replaced my camera variable with yours and it had the same result in-game, in studio it still works fine though… weird

Are you getting any errors at all?

In my output i’m not getting any related to the GUI.

Ok I shall ask this then: Is the script you’re using a Local or Server script?

it’s a localscript in the gui itself

Perhaps try printing?

--Music and Menu Handler

local frame = script.Parent
local blur = game.Lighting.DepthOfField
local playButton = script.Parent.PlayButton
local ambience = script.Parent.Ambience
local wind = script.Parent.Ambience2

print("We know this starting part works")

if frame.Visible == true then
	blur.Enabled = true 
end

if frame.Visible == true then
	ambience:Play()
	wind:Play()
end

playButton.MouseButton1Click:Connect(function()
	frame:Destroy()
end)

playButton.MouseButton1Click:Connect(function()
	ambience:Stop()
	wind:Stop()
end)

playButton.MouseButton1Click:Connect(function()
	blur.Enabled = false
end)

--Menu Camera

local camera = game.Workspace.Camera
local menuCamera = game.Workspace.MenuCamera

repeat wait()
    print("Loop running")
	camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = menuCamera.CFrame
print("Loop broke")

playButton.MouseButton1Click:Connect(function()
	camera.CameraType = Enum.CameraType.Custom
end)

-- Credits Gui

local creditsButton = script.Parent.CreditsButton
local creditsFrame = script.Parent.CreditsFrame

creditsFrame.Visible = false

creditsButton.MouseButton1Click:Connect(function()
	if creditsFrame.Visible == false then 
		script.Parent.CreditsFrame.Visible = true
	else
		script.Parent.CreditsFrame.Visible = false
	end
end)

I saw one “loop Broke” at line 44 in the output. Does it mean anything?

Was that the only thing it printed out? Or were there more statements?

(Also you didn’t really specify what problem you’re exactly having? :thinking: Like is the Camera not changing to where its supposed to be?)

Okay lemme word it a bit better
in studio, the title screen camera positions itself correctly to where it’s supposed to be
but in-game, it starts with the default camera, not the title screen camera

hope that cleared it up a little

Only things I could potentially see, is that the CameraType could still be set to Custom or the menuCamera variable isn’t exactly connecting in relation with the CFrame of the Player’s Camera