Hey so i made a main menu test and my friends were experiencing some glitches such as camera glitching out or gui not showing after respawn. Sometimes the Camera is just not on the player after i switch game.Workspace.Camera.CameraType
to custom. The main issue i'm experiencing is gui not showing up after death. Just nothing.
What it's supposed to show:
https://prnt.sc/uq5nr1
Camera glitch:
https://prnt.sc/uq5olr
The GUI glitch:
https://prnt.sc/uq5pqn
I wonder if there's any fix to that. I can provide the code i use if you just ask.
Also, i put in the console game:GetService("StarterGui").ResetPlayerGuiOnSpawn = true
, it didn't work. I made sure the property "ResetOnSpawn" is set to true and i still experience the same issue.
The code:
local camera = game.Workspace.CurrentCamera local player = game.Players.LocalPlayer repeat wait(.1) until player.Character.Humanoid.Parent ~= nil game.Lighting.Blur.Enabled = true camera.CameraType = "Scriptable" camera.CFrame = game.Workspace.Camera2.CFrame player.Character.Humanoid.WalkSpeed = 0 player.Character.Humanoid.JumpPower = 0 script.Parent.Parent.Visible = true player.Character.HumanoidRootPart.CFrame = game.Workspace.Tel.CFrame script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false repeat wait(.05) script.Parent.Parent.Parent.dark.BackgroundTransparency = script.Parent.Parent.Parent.dark.BackgroundTransparency - .01 until script.Parent.Parent.Parent.dark.BackgroundTransparency <= 0 wait(1) game.Lighting.Blur.Enabled = false script.Parent.Parent.Parent.dark.BackgroundTransparency = 1 player.Character.HumanoidRootPart.CFrame = game.Workspace.Tel2.CFrame game.Workspace.Camera.CameraType = "Custom" player.Character.Humanoid.WalkSpeed = 16 player.Character.Humanoid.JumpPower = 50 end) script.Parent.Parent.Customize.MouseButton1Click:Connect(function() game.Lighting.Blur.Enabled = false script.Parent.Parent.Visible = false camera.CFrame = game.Workspace.Camera3.CFrame script.Parent.Parent.Parent.Parent.Customize.Frame.Visible = true player.Character.HumanoidRootPart.CFrame = game.Workspace.Tel3.CFrame end)
The GUI may be removing itself because you don't have the ResetOnSpawn
property (which is found under the ScreenGui / GuiMain) disabled.
Try enabling it and then see what happens.
I'm not going to leave without giving you code that might help, so here you go.
local CurrentCamera = workspace.CurrentCamera local LocalPlayer = game:GetService("Players").LocalPlayer local BlurEffect = game:GetService("Lighting"):FindFirstChild("Blur") or Instance.new("BlurEffect",game:GetService("Lighting")) BlurEffect.Enabled = true CurrentCamera.CameraType = Enum.CameraType.Scriptable CurrentCamera.CFrame = workspace.Camera2.CFrame LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0 LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").JumpPower = 0 script.Parent.Parent.Visible = true -- Try using FindFirstAncestor("Name") here. LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = workspace["Tel"].CFrame local DarkFrame = script.Parent.Parent.Parent.dark script:FindFirstChildWhichIsA("GuiButton").MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false -- Try using FindFirstAncestor("Name") here. repeat wait(.05) DarkFrame.BackgroundTransparency = DarkFrame.BackgroundTransparency - .01 until DarkFrame.BackgroundTransparency <= 0 BlurEffect.Enabled = false DarkFrame.BackgroundTransparency = 1 LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = game.Workspace.Tel2.CFrame CurrentCamera.CameraType = Enum.CameraType.Custom LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 16 LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").JumpPower = 50 end) script.Parent.Parent.Customize.MouseButton1Click:Connect(function() end) script.Parent.Parent.Customize.MouseButton1Click:Connect(function() BlurEffect.Enabled = false script.Parent.Parent.Visible = false -- Try using FindFirstAncestor("Name") here. CurrentCamera.CFrame = workspace.Camera3.CFrame script.Parent.Parent.Parent.Parent.Customize.Frame.Visible = true -- Try using FindFirstAncestor("Name") here. LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = workspace.Tel3.CFrame end)
For gui not showing up, make sure you have a CharacterAdded Event, and make sure for the camera tht it's set to scriptable.