Camera type not working properly?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Fixing my game over screen

  2. What is the issue? Include screenshots / videos if possible!
    For some reason my camera flickers when i try to put my camera type to scriptable, keep in mind, it didnt do this before, it worked flawlessly, you can check my previous post for how it looked before
    https://gyazo.com/0d351cf290a367dc4163ad4fd983f008

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve looked, nothing came up yet, at least from the time i looked it up. I’ve already tried changing the script, nothing changes

c:WaitForChild('Humanoid').Died:Connect(function()
	p:FindFirstChild('StarterPlaylist').MegaloStrikeBack1:Stop()
	p:FindFirstChild('StarterPlaylist'):Destroy()
	wait(3)
	p.PlayerGui.ScreenGui.Frame.BackgroundTransparency = 0
	p.PlayerGui.ScreenGui.Frame.Sound:Play()
	for _, v in pairs(p.PlayerGui:GetDescendants()) do
		if v.Name == "Main" and v:IsA('ScreenGui') then
			v.Enabled = false
		end
	end
	wait(2)
	p.PlayerGui.ScreenGui.Frame.BackgroundTransparency = 1
	p.PlayerGui.ScreenGui.Frame.Sound:Play()
	go.HowUnfortunate:Play()
	go.Enabled = true
	local cam = workspace.CurrentCamera
	local camp = workspace:FindFirstChild('CamPoint')
	cam.CameraType = Enum.CameraType.Scriptable
	
	spawn(function()
		while go.Enabled == true do
			cam.CFrame = camp.CFrame

			wait()
		end
	end)
	spawn(function()
		while go.Enabled == true do
			cam.CFrame = camp.CFrame
			wait(.1)
		end
	end)

Any help would be great, you can tell me if im being dumb too

why are you using this code twice?

spawn(function()
        while go.Enabled == true do 
        cam.Cframe = camp.Cframe

        wait()
    end
end)
1 Like

oh, whoops, accidentally put that there
Edit: unfortunately it doesn’t fix anything

1 Like

Try this code:

c:WaitForChild('Humanoid').HealthChanged:Connect(function(change)
if change == 0 then
p:FindFirstChild('StarterPlaylist').MegaloStrikeBack1:Stop()
	p:FindFirstChild('StarterPlaylist'):Destroy()
	wait(3)
	p.PlayerGui.ScreenGui.Frame.BackgroundTransparency = 0
	p.PlayerGui.ScreenGui.Frame.Sound:Play()
	for _, v in pairs(p.PlayerGui:GetDescendants()) do
		if v.Name == "Main" and v:IsA('ScreenGui') then
			v.Enabled = false
		end
	end
	wait(2)
	p.PlayerGui.ScreenGui.Frame.BackgroundTransparency = 1
	p.PlayerGui.ScreenGui.Frame.Sound:Play()
	go.HowUnfortunate:Play()
	go.Enabled = true
	local cam = workspace.CurrentCamera
	local camp = workspace:FindFirstChild('CamPoint')
	cam.CameraType = Enum.CameraType.Scriptable
	
	spawn(function()
		while go.Enabled == true do
			cam.CFrame = camp.CFrame

			wait()
	 end	
end
end)
1 Like

Oh wow, surprisingly that worked! Thanks a lot!
I say surprisingly because i thought HealthChanged to 0 is exactly like Humanoid.Died

Humanoid.Died is kinda buggy. Don’t rely on it

1 Like

i’ll keep this in mind for the future, thanks again!

1 Like