Can any body help me? I'm having trouble making a Model follow me. I it works with a part, but I have a bee model and I want that to follow me, but it doesn't work. Can anybody tell me how I can fix it?
This is the script that I put in a part and it follows me:
local pet = script.Parent function givePet (player) if player then local character = player.Character if character then local humRootPart = character.HumanoidRootPart local newPet = pet:Clone () newPet.Parent = character local bodyPos = Instance.new("BodyPosition", newPet) bodyPos.MaxForce = Vector3.new(math.huge, math.huge, math.huge) local bodyGyro = Instance.new("BodyGyro", newPet) bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) while wait() do bodyPos.Position = humRootPart.Position + Vector3.new(2, 2, 3) bodyGyro.CFrame = humRootPart.CFrame end end end end game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) givePet(player) end) end)
But when I put that script in a model, it wont work. Can anybody tell me why?
Ok so you have a really easy problem here. I don't know if you you know this already, but in line 18, you cannot use vector 3 for models. You have to use CFrame, or MoveTo()