local StartCFrame = CFrame.new((HumanoidRootPart.CFrame.p + Vector3.new(0, 2, 0))) * CFrame.Angles(0, math.rad(xAngle), 0) * CFrame.Angles(math.rad(yAngle), 0, 0)
local Offset = Camera.CameraSettings.Offset
local CameraCFrame = StartCFrame + StartCFrame:VectorToWorldSpace(Vector3.new(Offset.X, Offset.Y, Offset.Z))
local CameraFocus = StartCFrame + StartCFrame:VectorToWorldSpace(Vector3.new(Offset.X, Offset.Y, -50000))
if CombatProperties.Target.Value then
local TargetRoot = CombatProperties.Target.Value:FindFirstChild("HumanoidRootPart")
if TargetRoot then
CameraCFrame = CFrame.new(HumanoidRootPart.Position, TargetRoot.Position)
end
end
local NewCameraCFrame = CFrame.new(CameraCFrame.p, CameraFocus.p) * (ShakeCFrame.Value)
Changes made:
Checked if CombatProperties.Target.Value is not nil and if it has a HumanoidRootPart.
Used :FindFirstChild("HumanoidRootPart") to get the HumanoidRootPart of the target player.
Ensure that the CombatProperties.Target.Value is set correctly to the player you want to target. If you continue to experience issues, you may need to debug further by printing values or checking for errors in the output. Correct me if im wrong or if i didnt fully understand what u meant