Pet movement being glitchy

Hey there, so I have this pet movement script but for some reason it started becoming really glitchy (video below), I haven’t touched the code and it randomly started doing this.

Video

Code
               local bodyPos = Instance.new("BodyPosition")
				bodyPos.MaxForce = Vector3.new(math.huge, math.huge, math.huge)

				local bodyGyro = Instance.new("BodyGyro")
				bodyGyro.MaxTorque = Vector3.new(math.huge, 8000, math.huge)

				bodyGyro.Parent = newPet.PrimaryPart
				bodyPos.Parent = newPet.PrimaryPart

				task.spawn(function()
					while task.wait() do
						if newPet then
							local newCFrame = humRootPart.CFrame * CFrame.new(-3, 1.25 + math.sin(tick()) * 0.25, 3)
							bodyPos.Position = Vector3.new(newCFrame.X, newCFrame.Y, newCFrame.Z)
							bodyGyro.CFrame = recipCharacter.Head.CFrame * CFrame.new(3, 0, -3)
						else
							break
						end
					end
				end)

Error:

:+1: Any help is very much appreciated, thank you sm in advance!

Have you tried disabling other scripts to see if it persists? if it fixes it enable them one by one until it doesn’t work correctly. Then you can go into the code of that script and fix the issue.