HumanoidRootPart Jittering

So long story short, I’m just working on some simple projectiles that spawn relative to the players position. But, when jumping, the projectiles will sometimes strafe left or right. This ONLY occurs when jumping whilst moving left, right, or backwards. The projectiles position are set using the HumanoidRootPart’s CFrame, however after some testing, I found out the HumanoidRootPart’s orientation jitters when jumping and moving in any direction that isn’t straight forward.

Whilst it is a minor gripe, as the strafing isint the worst, is there any solutions anybody could think of to possiblly stop, or even lessen the effect of this jitter?

A quick example of the jittering, If you want to test this out in Studio:

local Part = Instance.new("Part"); Part.Parent = workspace
Part.Anchored = true; Part.Size = Vector3.new(.5, .5, 4)
game:GetService("RunService").Heartbeat:Connect(function()
	Part.CFrame = script.Parent.HumanoidRootPart.CFrame + script.Parent.HumanoidRootPart.CFrame.LookVector*3
end)

You can simply weld the part to the HumanoidRootPart instead of setting the position repeatedly.

This should completely stop the jitter/strafing:

local Part = Instance.new("Part"); Part.Parent = workspace
Part.Anchored = true; Part.Size = Vector3.new(.5, .5, 4)
Part.CFrame = script.Parent.HumanoidRootPart.CFrame + script.Parent.HumanoidRootPart.CFrame.LookVector*3

local NewWeld = Instance.new("WeldConstraint", script.Parent.HumanoidRootPart)
NewWeld.Part1 =  script.Parent.HumanoidRootPart
NewWeld.Part0 = Part

Part.Anchored = false

Thanks for the reply.
This does work, but as stated, I am handling projectiles. The whole issue is rather of CFrame; The code snippet I posted was just an example to showcase the HumanoidRootPart jittering; Adding a weld basically makes it part of the HumanoidRootPart, A solution for things unlike projectiles, for sure, but not what I’m looking for.
Thank you, nonetheless.

Dont know if anyone cares too much, but if you ARE experiencing this issue, put AlignOrientation in the HumanoidRootPart. I managed to eliminate the weird jitter completely by setting its CFrame to the HumanoidRootParts CFrame in a Runservice.Heartbeat loop. You gotta do some other stuff, like check if the players in shiftlock or whatever is causing it for you and disable AlignOrientation if they’re not, but otherwise this worked for me.

3 Likes

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