Roblox Pet Follow Script (Smooth Floating Companion)
Makes equipped pets glide smoothly behind the player's shoulder with a lively sine-wave hover and zero physics jitter.
-- LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local OFFSET = CFrame.new(2.8, 1.4, 3.2)
local SMOOTHNESS = 8
RunService.RenderStepped:Connect(function(dt)
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart") :: BasePart?
local pet = workspace:FindFirstChild(player.Name .. "_Pet") :: Model?
if not (root and pet and pet.PrimaryPart) then return end
local bob = math.sin(os.clock() * 4) * 0.45
local target = root.CFrame * OFFSET * CFrame.new(0, bob, 0)
local alpha = 1 - math.exp(-SMOOTHNESS * dt)
pet:PivotTo(pet.PrimaryPart.CFrame:Lerp(target, alpha))
end)How to install in Studio
- Place this LocalScript in StarterPlayer > StarterPlayerScripts.
- Give your pet Model a PrimaryPart (Anchored = true, CanCollide = false).
- Name the spawned pet model '<PlayerName>_Pet' in Workspace to watch it follow.
Tips & customization
- Support multiple equipped pets by spacing them in a semicircle behind the player.
- Using 1 - math.exp(-SMOOTHNESS * dt) makes the motion identical at 60 FPS and 240 FPS.
Common questions.
Why animate pets on the client with RenderStepped?
Client-side CFrame Lerp looks buttery smooth at the player's monitor refresh rate and avoids server network lag.
More free Luau scripts.
LocalScript
Shift-to-Sprint Script
Hold Left Shift to sprint smoothly with a subtle camera FieldOfView boost and clean speed reset on release.
Copy script →
LocalScript
Double Jump Script
Lets players jump a second time mid-air using Roblox's JumpRequest event (works on PC, mobile, and controller).
Copy script →
Script
Kill Brick Script
Instead of copying 100 scripts into 100 lava bricks, tag any part 'KillBrick' and let one clean server script handle all of them.
Copy script →
Script
Round System Script
A clean server loop that runs Intermission -> Active Round -> Winner announcement and updates a shared Status StringValue for your HUD.
Copy script →
Skip manual wiring.
Let Revix code & playtest it.
Start building freeFree to start. No card needed.
