-
What do you want to achieve?
How to fix this. -
What is the issue? Include screenshots / videos if possible!
Camera glitch:
-
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