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)
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.