My pet’s body will follow me, but nothing else. I’ve tried weld constraints, but they don’t work.
Pet (Model) > Lot’s of mesh parts and PrimaryPart
Is there a way to make the entire pet move instead of scripting all of their body parts to move?
local Players = game:GetService("Players")
local function makePetFollowPlayer(pet, player)
local humanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
while true do
pet.PrimaryPart.CFrame = pet.PrimaryPart.CFrame:Lerp(humanoidRootPart.CFrame * CFrame.new(0, 3, 3), 0.1)
wait()
end
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
wait(2) -- Wait for the character to load
local pet = game.ServerStorage.Pet:Clone()
pet.Parent = game.Workspace
makePetFollowPlayer(pet, player)
end)
end)
You could use PivotTo, as the person above me suggested, or if that doesn’t work you could unanchor the other parts of the pet and weld them to the primary part. (Weld constraints or normal welds with a weld calculator would work)
local Players = game:GetService("Players")
local function makePetFollowPlayer(pet, player)
local humanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
while true do
pet.PrimaryPart:PivotTo(humanoidRootPart.CFrame * CFrame.new(0, 3, 3), 0.1)
wait()
end
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
wait(2) -- Wait for the character to load
local pet = game.ServerStorage.Pet:Clone()
pet.Parent = game.Workspace
makePetFollowPlayer(pet, player)
end)
end)