Pets movement system jittering

I have a pet system that uses align position and align orientation. My issue is that the pets are super jittery. Here is a video of it.

Here is the code that sets the target position for the two body movers.

		targetCF = Player.Character.HumanoidRootPart.CFrame *,0,3*math.floor(count))) -- * CFrame.Angles(0, 0, 0)

		local TargetPos = targetCF.Position
		local RayParams =
		RayParams.FilterDescendantsInstances = {Player.Character.PetFolder}
		RayParams.FilterType = Enum.RaycastFilterType.Exclude
		RayParams.RespectCanCollide = true

		local PetPosition, PetHeight = petModel:GetBoundingBox()
		PetPosition = PetPosition.Position
		PetHeight = PetHeight.Y

		local RayCast = workspace:Raycast(, Player.Character.Head.Position.Y, TargetPos.Z),,-20,0), RayParams)
		if RayCast and RayCast.Position then
			local y = RayCast.Position.Y + (PetHeight/2) - (PetPosition.Y - petModel.Center.Position.Y)
			targetCF =, y, TargetPos.Z)) * targetCF.Rotation

		if Player.Character.HumanoidRootPart.AssemblyLinearVelocity.Magnitude > .7 then
			targetCF =, targetCF.Position.Y + math.clamp(math.sin(tick() * 20),-.2,1), TargetPos.Z)) * targetCF.Rotation * CFrame.Angles(-math.rad(MaxRotation * math.sin(tick() * 15)), 0, -math.rad(MaxRotation * math.sin(tick() * 10)))

		petModel:WaitForChild("Center").AlignPosition.Position = targetCF.Position
		petModel.Center.AlignOrientation.CFrame = targetCF

I have tried using a lerp instead of body movers and still run into the same issues. Here are the settings for the body movers

local AlignOrientation ="AlignOrientation", Clone.Center)
	AlignOrientation.Attachment0 = Clone.Center.Attachment
	AlignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
	AlignOrientation.Responsiveness = 25
	AlignOrientation.MaxTorque = 25000

	local AlignPosition ="AlignPosition", Clone.Center)
	AlignPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
	AlignPosition.MaxForce = 25000
	AlignPosition.Responsiveness = 25
	AlignPosition.MaxVelocity = 1000
	AlignPosition.ApplyAtCenterOfMass = true
	AlignPosition.Attachment0 = Clone.Center.Attachment
	AlignPosition.Position = Player.Character.PrimaryPart.Position

If anyone has any ideas, please let me know.


Have you tried setting the NetworkOwner of the pet to the player?

Yes, the network owner is the player.

I didn’t use network owner … This took me over a year to get down, they move as smooth as glass now. My scripts are loosely based off this system Good Luck!

I tried not using network owner and it didn’t make a difference, I would also prefer to not use depricated instances.

All I know is that way is super super smooth movement. Check out his video, it sold me. Not saying you’re wrong … I’ve never seen pets move as smooth as mine.

Did it a bit different in the loop …
This is a raw snip kind of just showing the loop. The lines above are moved down to show what they are.

local hrp = char.HumanoidRootPart pet.Position = hrp.Position
local bg ="BodyGyro", pet)
local bp ="BodyPosition", pet)
bp.MaxForce =, huge, huge)
bg.MaxTorque =, huge, huge)
bp.Position = hrp.Position - (hrp.CFrame.RightVector * 4.1)
bg.CFrame =, hrp.CFrame.LookVector 
	* 10000) * CFrame.Angles(0, math.rad(-3), 0) 

while true do
	if pet ~= nil then else break end
	if char.Humanoid.Health < 1 then break
	end	rs.Stepped:Wait()
	if pet.Parent == char then
		bp.Position = hrp.Position - (hrp.CFrame.RightVector * 4.1)
		bg.CFrame =, hrp.CFrame.LookVector 
			* 10000) * CFrame.Angles(0, math.rad(-3), 0)
	else break

I move this script (the whole thing, not just this snip) into the pet - script disabled, then turn it on … and off they go following. I’m also sure rs.Stepped:Wait() is helping the smoothness.

The code isn’t the problem, what loops are you using, or what events are you connecting to to run this code? Task Scheduling-wise, also is this Server-Sided or Client-Sided

something that might work is TweenService:Create(part,, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, {CFrame = cframe}):Play()