Character stuttering when using CameraOffset

Hello!
When I apply the CameraOffset property in my Humanoid the character stutters whenever it rotates. Wondering if there’s any fix or an alternative to CameraOffset.

Script:

local plr = game.Players.LocalPlayer
local tool = script.Parent
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")
local hrp = char:WaitForChild("HumanoidRootPart")
local usersettings = UserSettings().GameSettings


tool.Unequipped:Connect(function()
	hum.CameraOffset = Vector3.new(0,0,0)
	uis.MouseBehavior = Enum.MouseBehavior.Default
	usersettings.RotationType = Enum.RotationType.MovementRelative
end)

tool.Equipped:Connect(function()
	
	hum.CameraOffset = Vector3.new(5,2,0)
	
	uis.MouseBehavior = Enum.MouseBehavior.LockCenter
	usersettings.RotationType = Enum.RotationType.CameraRelative
end)

Video:

2 Likes

Hi
Try attaching the camera to your head, and change the camera offset.
If it doesn’t work, I don’t know how to fix it. I guess some other way

This could be simply because you’re modifying many cam-related properties in rapid succession. While I see the need for them, I suggest, maybe, tweening the cam offset (once only)?

local plr = game.Players.LocalPlayer
local tool = script.Parent
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")
local TS = game:GetService('TweenService')
local hrp = char:WaitForChild("HumanoidRootPart")
local usersettings = UserSettings().GameSettings
local TI = TweenInfo.new(.1)

tool.Unequipped:Connect(function()
	TS:Create(hum,TI,{CameraOffset = Vector3.zero}):Play()
	uis.MouseBehavior = Enum.MouseBehavior.Default
	usersettings.RotationType = Enum.RotationType.MovementRelative
end)

tool.Equipped:Connect(function()
	
	TS:Create(hum,TI,{CameraOffset = Vector3.new(5,2,0}):Play()
	
	uis.MouseBehavior = Enum.MouseBehavior.LockCenter
	usersettings.RotationType = Enum.RotationType.CameraRelative
end)

If you’re referring to the character jerking when rotating in place, I think the only way to fix that is to use physical properties. You might want to look into that option.

Didn’t know camerarelative was a thing.
I use the mouse’s delta in a runservice loop and I don’t see stutter. Maybe I just didn’t look close enough, dunno.

You can using this way by not changing CameraOffset, but there’s few detail you need to fix it

result like this:

fixing_camera_shaking.rbxl (327.0 KB)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.