Camera is stuck at a position

  1. What do you want to achieve?
    How to fix this.

  2. What is the issue? Include screenshots / videos if possible!
    Camera glitch:

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried looking at the dev hub.

Camera in client:

	if input.KeyCode == Enum.KeyCode.F and not gpe and FocusedTarget then
		local walkspeedOld = char.Humanoid.WalkSpeed
		if (FocusedTarget.PrimaryPart.Position - char.PrimaryPart.Position).Magnitude < 15 and FocusedTarget.Staggered.Value == true then
			if FocusedTarget.Parent == nil then
				FocusedTarget.AncesteryChanged:wait()
			else
				enemyTrack = FocusedTarget.Humanoid.Animator:LoadAnimation(script.Enemy)
				playerTrack = char.Humanoid.Animator:LoadAnimation(script.Player)
			end
			local cframeLookAt = CFrame.lookAt(FocusedTarget.Bruh.Position, FocusedTarget.HumanoidRootPart.Position)
			workspace.CurrentCamera.CameraType = Enum.CameraType.Follow
			workspace.CurrentCamera.CameraSubject = FocusedTarget.Head
			char:SetPrimaryPartCFrame(cframeLookAt)
			task.wait(.1)
			if FocusedTarget then
				
			else
				warn("Target is nil, switching.")
				FocusedTarget =  math.random(#workspace.Enemies)
			end
			FocusedTarget.Humanoid.WalkSpeed = 0
			char.Humanoid.WalkSpeed = 0
			char.PrimaryPart.Anchored = true
			FocusedTarget.PrimaryPart.Anchored = true
			enemyTrack:Play(_,_,.5)
			playerTrack:Play(_,_,.5)
			FocusedTarget.Sounds.Glorified[1]:Play()
			FocusedTarget.Sounds.Glorified[1].Ended:Connect(function()
				FocusedTarget.Sounds.Glorified[2]:Play()
			end)
			task.wait(1.325)
			remote.Parent.Glorified2:FireServer(char)
			char.PrimaryPart.Anchored = false
			char.Humanoid.Jump = true
			char.Humanoid.WalkSpeed = walkspeedOld
			workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
			workspace.CurrentCamera.Focus = char.Head.CFrame
			--workspace.CurrentCamera.CameraSubject = char.Head
			if FocusedTarget then
				for i, v in pairs(FocusedTarget:GetChildren()) do
					if v:IsA("Part") then
						if v:FindFirstChild("SelectionBox") then
							repeat v.SelectionBox:Destroy() until not v:FindFirstChild("SelectionBox")
						end
					end
				end
			end
		end
		FocusedTarget:Destroy()
		table.remove(Targets, 1)
		FocusedTarget = nil
	end
1 Like

Well the video is stuck for me also, Can you reply me by a another image of it?

1 Like

It happens sometimes for me while testing, just try to replay your experience

image

Did you retry after the problem occured ?

As in restart studio? I need 3x10

What do you mean by 3x10 @DeltOof12345 ??

3x10 characters. I also need 3x10 chars more.

The Camera in Client script, try setting the CurrentCamera.CameraSubject to the Humanoid of the Char Also try setting the camera subject back to the Humanoid before you do anything else. This will make sure to set the cameras position back before if something goes bad at least the player can still see.

1 Like

you are apparantly not allowed to say 30 Letters but replace the word Letters with Characters

Thanks! Works perfectly. I need to type some more characters, Thank you!

1 Like