weite lus code for rovlox my dummy follows me anywhere i go really smooth do locam dummy…
- User
weite lus code for rovlox my dummy follows me anywhere i go really smooth do locam dummy = script.parent
Assistant
Smooth Following Dummy Script for Roblox
Here's a Lua script that will make a dummy (model or part) smoothly follow your character in Roblox:
lualocal dummy = script.Parent local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() -- Configuration local FOLLOW_DISTANCE = 5 -- How far behind to stay local SMOOTHNESS = 0.2 -- Lower values = smoother movement (0-1) local HEIGHT_OFFSET = 2 -- How much above the ground to float -- Make sure dummy has a PrimaryPart if it's a model if dummy:IsA("Model") and not dummy.PrimaryPart then if dummy:FindFirstChild("HumanoidRootPart") then dummy.PrimaryPart = dummy.HumanoidRootPart else -- If no obvious primary part, use the first BasePart found for _, child in ipairs(dummy:GetDescendants()) do if child:IsA("BasePart") then dummy.PrimaryPart = child break end end end end -- Main follow loop local function followCharacter() while true do if character and character:FindFirstChild("HumanoidRootPart") and dummy.PrimaryPart then local rootPart = character.HumanoidRootPart local targetCFrame = rootPart.CFrame * CFrame.new(0, 0, FOLLOW_DISTANCE) * CFrame.Angles(0, math.pi, 0) -- Smooth position interpolation dummy.PrimaryPart.CFrame = dummy.PrimaryPart.CFrame:Lerp( targetCFrame + Vector3.new(0, HEIGHT_OFFSET, 0), SMOOTHNESS ) -- Optional: Make dummy face the same direction as player dummy.PrimaryPart.CFrame = CFrame.new( dummy.PrimaryPart.Position, rootPart.Position ) end game:GetService("RunService").Heartbeat:Wait() end end -- Start following followCharacter()How to Use:
- Insert this script into your dummy object (model or part)
- Make sure the dummy has a PrimaryPart if it's a model
- Adjust the configuration variables at the top to change following behavior
Features:
- Smooth movement using linear interpolation (Lerp)
- Configurable follow distance and smoothness
- Height offset to prevent clipping with ground
- Faces the player's character
- Works with both models and single parts
Notes:
- For best results, the dummy should be a model with a Humanoid (like an R15 character)
- If using a single part, it will still follow but won't animate
- You may need to adjust the SMOOTHNESS value based on your desired effect
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.