Blog / Roblox pets

Guide

Roblox pet follow script: how to make a pet follow you

A Roblox pet follow script with AlignPosition and AlignOrientation. Set up the pet model, make it follow you smoothly and fix lag, falling and spinning.

Published 9 min readby the Synagy team, written with AI

Short answer: a Roblox pet follow script needs two constraints on the pet. An AlignPosition pulls it toward an Attachment behind the player, and an AlignOrientation turns it the same way. Create both from a server Script when the character spawns. Unanchor and weld the pet first, then give its network ownership to the player. Responsiveness, which ranges from 5 to 200, sets how tightly the pet keeps up.

This guide walks through the pet model, the full script, several pets in a row and the bugs people hit most. Everything below was checked against the Roblox Creator Docs on December 4, 2026. It does not cover pet inventories, saving or egg hatching. Those get their own guides on our Roblox pets topic page.

Which way should a pet follow the player?

Use constraints. AlignPosition and AlignOrientation move the pet with physics, so it eases toward the player instead of jumping. Older tutorials use BodyPosition and BodyGyro, but the BodyPosition reference is now tagged as deprecated.

There are 5 common ways to do it. They differ in smoothness, in who sees the pet and in how much code they need.

MethodSmooth for the ownerOther players see itStatus
AlignPosition + AlignOrientation, owned by the playerYesYesCurrent, the method in this guide
CFrame updates in a LocalScript every frameYesOnly if every client draws every petCurrent, common in big simulators
Server loop that sets the CFrameNo, it moves in stepsYesWorks, but looks choppy
BodyPosition + BodyGyroYesYesDeprecated
Pet with a Humanoid and MoveToWalks on the groundYesCurrent, but needs a walk animation

The client-only method is the smoothest. It also means writing your own system to show other players' pets. For a first pet, the constraint method is the best trade: one server Script of about 50 lines, and every player sees the pet.

How do you set up the pet model?

Build the pet as one Model with a root part, weld every other part to that root, and unanchor everything. A pet that is anchored will never move, and one without welds falls apart.

  1. Group itselect all parts, press Ctrl+G, name the model Pet
  2. Pick a rootset the model's PrimaryPart to its body or a small invisible box
  3. Weld itadd a WeldConstraint from each part to the root
  4. Unanchorturn off Anchored on every part
  5. No collisionsturn off CanCollide so the pet never pushes you
  6. Store itmove the model into ServerStorage
Prepare a pet model in six steps
  1. Group the parts of your pet with Ctrl+G and name the model Pet. A mesh from Blockbench or the Toolbox works the same way.
  2. Select the model and set PrimaryPart in the Properties window. The Model reference notes that models have no PrimaryPart by default.
  3. Right-click the root part in the Explorer, choose Insert Object and add a WeldConstraint for each other part. Set Part0 to the root and Part1 to the other part.
  4. Turn off Anchored on every part, including the root.
  5. Turn off CanCollide. Also turn off CanQuery if your weapons use raycasts, so shots pass through pets.
  6. Drag the finished model into ServerStorage.

How do you write the pet follow script?

Put one Script in ServerScriptService. When a character spawns, it clones the pet, adds an Attachment to the pet and a second one to the character's HumanoidRootPart, and links them with the two constraints.

```lua -- Script in ServerScriptService local Players = game:GetService("Players") local ServerStorage = game:GetService("ServerStorage")

local petTemplate = ServerStorage:WaitForChild("Pet") local OFFSET = Vector3.new(3, 1, 3) -- 3 right, 1 up, 3 behind local petsByPlayer = {}

local function removePet(player) if petsByPlayer[player] then petsByPlayer[player]:Destroy() petsByPlayer[player] = nil end end

local function givePet(player, character) removePet(player) local rootPart = character:WaitForChild("HumanoidRootPart") local pet = petTemplate:Clone() local petRoot = pet.PrimaryPart

local petAttachment = Instance.new("Attachment") petAttachment.Parent = petRoot

local slot = Instance.new("Attachment") slot.Name = "PetSlot" slot.Position = OFFSET slot.Parent = rootPart

local alignPosition = Instance.new("AlignPosition") alignPosition.Attachment0 = petAttachment alignPosition.Attachment1 = slot alignPosition.Responsiveness = 25 alignPosition.MaxForce = 25000 alignPosition.Parent = petRoot

local alignOrientation = Instance.new("AlignOrientation") alignOrientation.Attachment0 = petAttachment alignOrientation.Attachment1 = slot alignOrientation.Responsiveness = 25 alignOrientation.MaxTorque = 25000 alignOrientation.Parent = petRoot

pet:PivotTo(slot.WorldCFrame) pet.Parent = workspace petsByPlayer[player] = pet petRoot:SetNetworkOwner(player) end

Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) givePet(player, character) end) end) Players.PlayerRemoving:Connect(removePet) ```

What each part does:

The player is never dragged around. The AlignPosition guide says that with ReactionForceEnabled off, the default, the constraint only pushes Attachment0. Attachment1 stays unaffected.

Why does the pet lag behind the player?

The pet lags when the server simulates it. Each position then has to travel to the player's device first. Calling SetNetworkOwner(player) on the pet's root hands the physics to the player's device, so the pet moves in step with the character.

The network ownership page adds two rules:

How do you tune how the pet moves?

Change Responsiveness first. The other properties only cap the force and speed. The AlignPosition reference calls MaxForce and MaxVelocity caps and says the actual scale comes from Responsiveness.

5–200allowed Responsiveness on both constraints
25Responsiveness in the script above
16studs per second, the default walk speed
2constraints per pet
PropertyWhat it doesTry this
ResponsivenessHow fast the pet closes the gap10 to 15 for a lazy float, 40 or more for a tight follow
MaxForceThe most force the constraint may useRaise it if a heavy pet sinks below its slot
MaxVelocityThe top speed while it catches upLeave it unless the pet overshoots
RigidityEnabledOff by default; on makes the solver align as fast as it canKeep it off, or the pet moves like it is welded
AlignOrientation MaxTorqueHow hard the pet turns to face your wayRaise it if the pet turns slowly

The 16 studs per second come from the Humanoid reference. If your game has sprinting, test the pet at your top speed. A low Responsiveness lets it fall far behind.

How do you make several pets follow one player?

Give every pet its own slot Attachment and spread the slots in an arc behind the player. The rest of the script stays the same.

```lua local RADIUS = 5

local function slotOffset(index, count) local angle = (index / (count + 1) - 0.5) math.pi return Vector3.new(math.sin(angle) RADIUS, 1, math.cos(angle) * RADIUS) end ```

Use slotOffset(i, count) instead of the fixed OFFSET for pet number i. With 3 pets, the slots sit 5 studs away at −45°, 0° and 45° behind the player. When a pet is added or removed, set every slot's Position again with the new count.

Why does a pet not follow the player?

Most failures come from an anchored part, missing welds or collisions. Check the Output window for errors, then go down this table.

What you seeLikely causeFix
The pet does not move at allA part is still anchoredTurn off Anchored on every part
The pet falls apartParts are not welded to the rootAdd a WeldConstraint for each part
The pet trips or pushes the playerCanCollide is onTurn off CanCollide on every part
The pet stutters for its ownerThe server simulates itCall SetNetworkOwner(player)
The pet sinks below its slotMaxForce is too low for its massRaise MaxForce or set Massless on child parts
The pet spins or tips overNo AlignOrientationAdd AlignOrientation to the same two attachments
The pet flies across the map after a teleportIt chases the new slotCall PivotTo on the pet right after the teleport
Output shows "attempt to index nil with 'SetNetworkOwner'"The model has no PrimaryPartSet PrimaryPart before you store the model

Where does this method stop?

The pet floats at a fixed height next to the player's root part. On stairs it rises and falls with the player, not with the ground. That suits flying pets, ghosts and orbs. A dog that trots on the floor needs a different build.

For a walking pet, give it a Humanoid, call MoveTo toward a point behind the player and play a walk animation. The Humanoid reference says MoveTo gives up after 8 seconds if the goal is not reached, so call it again on a loop. Our guide on how to animate an NPC in Roblox Studio covers rigs, walk clips and the script that plays them.

If you would rather not rig and animate each pet by hand, Synagy is an upcoming tool for that. It is being rebuilt and is not open yet. The plan: you describe a pet and pick Roblox, and you get a .rbxm model with a rig and four animations (idle, walk, attack, death), checked first in a live 3D preview. The follow script above works with any pet model either way. The waitlist on synagy.org gives you a permanent Founder number.

FAQ

How do you make a pet follow you in Roblox without lag?

Move the pet with AlignPosition and AlignOrientation, then call SetNetworkOwner(player) on its root part from the server. The player's device then simulates the pet together with the character. In games that use Server Authority, skip SetNetworkOwner, because Roblox predicts constrained parts on its own.

Should a pet follow script be a Script or a LocalScript?

Use a server Script in ServerScriptService for the constraint method. The server creates the pet, so every player sees it. A LocalScript only fits the client-only method, where each player's device moves and draws every pet by itself.

Can a Roblox pet walk on the ground instead of floating?

Yes, but not with this script alone. Give the pet a Humanoid, move it with MoveTo toward a point behind the player and play a looped walk animation. MoveTo times out after 8 seconds, so call it again regularly while the player moves.

Is BodyPosition still fine for a pet follow script?

It still runs in many old games, but Roblox tags BodyPosition as deprecated. New pets should use AlignPosition and AlignOrientation. They do the same job, take two attachments instead of a target position, and get current support from Roblox.

How far behind the player should a pet float?

A slot about 3 studs to the side and 3 studs behind keeps a small pet visible without blocking the camera. Bigger pets need more room. Change the OFFSET vector, test in Play mode and move the slot until the pet stays out of the way.

Written with AI and checked automatically before publishing, without a human editor. Spotted a mistake? Tell us and we fix it.

Something new is hatching. Synagy is being rebuilt from the ground up. Join the waitlist or read more on the blog.