Camera Manipulation code not resetting

The code has worked before but not what I am trying to achieve now, my goal is to reset the camera so the player has their camera back not a set position as I have it.

my code

local TweenService = game:GetService("TweenService")
local runService = game:GetService("RunService")

local Prompt = game.Workspace.signupredirectlol.ProximityPrompt
local CGUI = game.StarterGui.CGUI
local No = game.StarterGui.CGUI.No

CurrentCamera.CameraType = Enum.CameraType.Scriptable

local Animation = TweenService:Create(CurrentCamera, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut, 0, false, 0), {["CFrame"] = workspace.REODPART.CFrame})

TEST = false

Prompt.Triggered:Connect(function(player)
	task.wait(0.1)
	Prompt.Enabled = false
	Animation:Play()
	Animation.Completed:Wait()
	runService.RenderStepped:Connect(function()
		if TEST == false then
			CurrentCamera.CFrame = CFrame.new(workspace.REODPART.Position, workspace.FOCUSPART.Position)
		end
		if TEST == true then
			workspace.FOCUSPART:Destroy()
			workspace.REODPART:Destroy()
			CurrentCamera.CameraSubject = CurrentCamera.CameraSubject.Humanoid
			CurrentCamera.CameraType = CurrentCamera.CameraType.EnumType.Fixed
		end
		No.MouseButton1Click:Connect(function()
			TEST = true
		end)
	end)
end)

A video of the code working but not resetting

don’t mind the background noises, I accidentally left my mic on sorry
After the white clerk’s last line of speech goes, the camera should originate back to the player’s camera.
Not sure why it isn’t working. Any help will be appreciated greatly.

1 Like

Unless you’re using a custom camera then you need to reset the CameraType to ‘Custom’ & not ‘Fixed’

Also why are you doing this:

CurrentCamera.CameraSubject = CurrentCamera.CameraSubject.Humanoid
2 Likes

I pretty much lost my mind while trying, I’ve tried several ways but I am still learning cameras so bear with me if you can lol.

1 Like

Okay, I’ve fixed it to what you said.
Though it still does not work.

Prompt.Triggered:Connect(function(player)
	task.wait(0.1)
	Prompt.Enabled = false
	Animation:Play()
	Animation.Completed:Wait()
	runService.RenderStepped:Connect(function()
		if TEST == false then
			CurrentCamera.CFrame = CFrame.new(workspace.REODPART.Position, workspace.FOCUSPART.Position)
		end
		if TEST == true then
			CurrentCamera.CameraType = Enum.CameraType.Custom
		end
		No.MouseButton1Click:Connect(function()
			CurrentCamera.CameraType = Enum.CameraType.Custom
			TEST = true
		end)
	end)
end)

I added the TEST = true as a backup in case the first line doesnt work.

1 Like

Make sure you also set the Camera.CFrame back to the characters head as well

That’s what I was trying to do, how do I correctly do that?

It would be as simple as:

CurrentCamera.CameraType = Enum.CameraType.Custom
CurrentCamera.CFrame = player.Character.Head.CFrame
1 Like

It still won’t reset even when I use your code.