Player Camera not swapping to new character

This is the script in a local inside the playerscripts:

local StarterGui = game:GetService("StarterGui")
lantern=game.Players.LocalPlayer.Character:FindFirstChild("Lantern")
lantern.RemoteEvent.OnClientEvent:Connect(function()
	print(game.Players.LocalPlayer.Character)
	game.Workspace.CurrentCamera.CameraSubject=game.Players.LocalPlayer.Character
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
end)

and here is the server script inside the tool:

fire=game.ServerStorage.Tools.Lantern.LanternFire:Clone()
	fire:PivotTo(Emitter.Parent.WorldCFrame)
	fire.Parent=workspace
	script.Parent.RemoteEvent:FireClient(player)
	pchar=player.Character
	player.Character=fire
	pchar.Parent=workspace
2 Likes

Have you tried making the subject the characters’ humanoid?

1 Like

Yes I have, camera doesn’t change at all, I rewrote the script and it’s doing what i want it to do, but i still dont know what was going on here

1 Like

I think what happened is that you were setting the player’s character to the fire

1 Like

Is the new character you are switching to already in the workspace?
Also can you show what the variable pchar is?

1 Like

pchar is the players character before the switch, i define it so i can keep it in the workspace after the character switch

1 Like