Hello Everyone!
today i have created a script that is a fixed ROBLOX gear and the gear has a dog that follows you everytime you walk i completed that.
but i want to apply the default r6 animation to the spawned doge im gonna show everyone the Walk function so you guys can help me
local function FollowPlayer(player, SpawnedDoge, DogeHumanoid)
spawn(function()
while Spawned and player.Character and player.Character:FindFirstChild("HumanoidRootPart") do
local playerPos = player.Character.HumanoidRootPart.Position
local dogePos = SpawnedDoge.HumanoidRootPart.Position
-- Check distance to decide mode
if (playerPos - dogePos).magnitude > 5 then
Mode = "Follow"
DogeHumanoid:MoveTo(playerPos + Vector3.new(2, 0, 2))
else
Mode = "Idle"
end
wait(0.1)
end
end)
end