Hello there! I’m working on a third person weapon system and there’s an issue with binding the player’s character to their camera. The code that manipulates the camera is as shown here:
local position = rootPart.CFrame.Position
local offsetType = (isScoping and scopingCameraOffset) or normalCameraOffset
local origin = CFrame.new(position) * CFrame.Angles(0, math.rad(cameraX), 0) * CFrame.Angles(math.rad(cameraY), 0, 0)
local current = origin:PointToWorldSpace(offsetType)
local focus = origin:PointToWorldSpace(Vector3.new(offsetType.X, offsetType.Y, -100000))
camera.CFrame = camera.CFrame:Lerp(CFrame.new(current, focus), 0.25)
if isScoping then
local xVector = CFrame.lookAt(position, camera.CFrame:PointToWorldSpace(Vector3.new(0, 0, massiveFloat))).XVector
rootPart.CFrame = CFrame.fromMatrix(position, xVector, rootPart.CFrame.YVector)
end
While this results in smooth character manipulation on the client, other players see this: 2022-02-20 18-58-36
Is there a fix to this? I’ve tried using BodyGyros to change the CFrame but they’re not instant.