Im wondering how you would go about making a character follow system sort of thing similair to anime vanguards. The idea is that i have characters following the player around. right now im not thinking about anims just wanna get the follow system to work.
Ive tried by having welds attached the dummy and the player character, it just results in the players character moving really slow and after doing a bunch of research i cant find a solution. I also tried scripting the dummy to follow the player but and it works but it vibrates/lags its really weird. i tried lerping and adding a loop to make it move to the position of the character more frequently but it doesnt work.
heres the script (put in serverscript service):
local RunService = game:GetService("RunService")
game.Players.PlayerAdded:Connect(function(plr)
wait(5) -- Wait 5 seconds after the player joins
local dummy = game.Workspace:FindFirstChild("1") -- Find the dummy named "1"
if dummy and dummy:FindFirstChild("HumanoidRootPart") and dummy:FindFirstChild("Humanoid") then
local humanoid = dummy.Humanoid
RunService.Heartbeat:Connect(function()
if plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
local playerRoot = plr.Character.HumanoidRootPart
-- Create the offset (2 studs to the left, 3 studs behind the player)
local offset = playerRoot.CFrame.RightVector * -2 + playerRoot.CFrame.LookVector * -3
local targetPosition = playerRoot.Position + offset
-- Update the dummy's position and rotation to match the player
dummy.HumanoidRootPart.CFrame = CFrame.new(targetPosition, targetPosition + playerRoot.CFrame.LookVector)
-- Move the dummy smoothly to the target position
if (dummy.HumanoidRootPart.Position - targetPosition).Magnitude > 0.1 then
humanoid:MoveTo(targetPosition)
end
end
end)
end
end)
Any ideas would be greatly appreciated thanks.