Player resseting/dying breaks the players camera

So whenever a player ressets or dies it keeps the camera in the same place.
This is the serverside code

player.CharacterAdded:Connect(function(char)
		game.ReplicatedStorage.ItemShopRemoteFunctions.PlayerReset:FireClient(player)
		player.OtherInfo.InShop.Value = false
		char.ChildAdded:Connect(function(child)
			if child:IsA("Tool") then
				player.ToolEquipped.Value = child.Name
			end
		end)
		if game.ServerStorage.Clocks:FindFirstChild(player:WaitForChild("ToolEquipped").Value) then
			local toolToEquip = game.ServerStorage.Clocks[player.ToolEquipped.Value]:Clone()
			local backpackToEquip = game.ServerStorage.Backpacks[player.Backpackequipped.Value]
			backpackToEquip.Parent = player.Character
			toolToEquip.Parent = player:WaitForChild("Backpack")
		end
	end)

Client Side code

replicatedStorage.ItemShopRemoteFunctions.PlayerReset.OnClientEvent:Connect(function()
	shopFrame.Visible = false
	currentBox.Value = 1
	shopFrame.ModelName.Value = 1
	forward.TextColor3 = ENABLED_BUTTON_COLOR
	back.TextColor3 = ENABLED_BUTTON_COLOR
	
	camera.CameraType = "Custom"
	camera.CameraSubject = player.Character:WaitForChild("Humanoid")
	player.OtherInfo.InShop.Value = false
end)

It still lets the user move around but it doesnt follow the camera after them. Any ideas?

EDIT: If I remove the
game.ReplicatedStorage.ItemShopRemoteFunctions.PlayerReset:FireClient(player) then it still won’t let the player move the camera

1 Like

Try replacing camera.CameraType = "Custom" to camera.CameraType = Enum.CameraType.Custom

Still doesn’t work
30 characters

To begin with as @FlashFlame_Roblox said your first error is the camera.CameraType.

Secondly, I find it confusing why you have done this method seeming as on death unless you’ve overridden the camera, the subject should automatically return to the new character?

Also please hit F9 and tell us any errors you receive?

1 Like

Im running it in studio and I get no errors

As I said though, why do you need to do this?

What is the end goal your trying to achieve and what was happening previously to make it required that you do this - seeming as your essentially doing what the camera would do by default?

I think he’s following the AlvinBlox’s mining shop tutorial. There are some camera manipulation steps in that video.

Also, try setting the camera type to Scriptable if your scripting custom behavior.

Else if you don’t want custom behavior the moment a player spawns you should probably leave it.

2 Likes

But if I coment the camera out then it still does the same thing

1 Like

Also I have got a shop using camera manipulation so if the player resets I want the camera to go back to default

1 Like

Your following AlvinBlox’s tutorial aren’t you, if so then the methodology he used on creation broke:

If you really need to force the Players camera back to the character then either:

  • go to video 5 if your continuing the tutorial and copy the source code as he said in the description.
  • set the current camera CFrame to the Character’s primary part CFrame.

I can’t help you really if your following a tutorial as he’ll have his methods which I may not particularly agree with.

3 Likes