Pets moving weirdly


game:GetService("RunService").RenderStepped:Connect(function()
        local char = plr.Character
        local PetTable = workspace.Pets:WaitForChild(plr.Name):GetChildren()
        local PetOffset = CFrame.new(0,1.3* math.sin(tick() * 4),10)
        for i, v in pairs(workspace.Pets:WaitForChild(plr.Name):GetChildren()) do
            local Offset = 0.3
            local PetHolder = workspace.Pets:WaitForChild(plr.Name):GetChildren()
            local Angle = ((i + Offset) / #PetHolder) * math.pi * 2
            v.PrimaryPart.BodyPosition.Position = (char.HumanoidRootPart.CFrame * CFrame.Angles(0,Angle,0) * PetOffset * CFrame.new(0,1,0)).p
            v.PrimaryPart.BodyGyro.CFrame = CFrame.new(v.PrimaryPart.Position, char.HumanoidRootPart.Position)
        end
    end)

How do I prevent pets from moving like this?

https://www.roblox.com/games/5414779423/5M-EVENT-Science-Simulator?refPageId=2f115998-06f2-47de-9898-7e7c5f123088

This game pet moves totally differently. And I know the developers use body movers I talked with the Scripter once.

Do you mean stop the pets from rotating with you?

If so then you can change

char.HumanoidRootPart.CFrame

to

CFrame.new(char.HumanoidRootPart.CFrame.p)

in BodyPosition.Position so the cframe only has the x,y,z of your rootpart, without the rotation matrix