Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Camera dont move when i reset my Character?

Camera stop moving when i reset my character. Its my own isometric camera

-------------------------------------------------------------------
repeat wait() until game.Players.LocalPlayer.Character
----------------------------------------[?????????]----------------------------------------
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = player.Character

----------------------------------------[????????]----------------------------------------
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 20
character.Humanoid.WalkSpeed = 16
local rotate = 0
local debuging = false
----------------------------------------[???????]----------------------------------------
function cameramove ()
	workspace.CurrentCamera.CFrame = CFrame.new(character.HumanoidRootPart.Position)*CFrame.Angles(0,math.rad(rotate),0)*CFrame.new(Vector3.new(50,100,50),Vector3.new(character.HumanoidRootPart.Position))
end
function rotatechange(input,event)
	if input.KeyCode == Enum.KeyCode.E then

		for i = rotate,rotate+90,10 do 
			rotate = i
			wait()
		end
		debuging = false
	end
	if input.KeyCode == Enum.KeyCode.Q and debuging == false then
		debuging = true
		for i = rotate,rotate-90,-10 do 
			rotate = i
			wait()
		end
		debuging = false
	end
end



----------------------------------------[??????]----------------------------------------
game:GetService("RunService"):BindToRenderStep("Camera",Enum.RenderPriority.Camera.Value,cameramove) -- ???? ??????
game:GetService("UserInputService").InputBegan:connect(rotatechange)

1 answer

I'd make a Humanoid.Died event that resets your camera back to the defaults

player.Character.Humanoid.Died:Connect(function()
	camera.CameraType = "Custom"
	camera.CameraSubject = player.Character.Humanoid
end)

1 comment

0

Sorry, but camera position doesn't change when player died.

This discussion is preserved as it was. New answers, comments, and votes are closed.