Hey! So, I am trying to set up a pet follow script, I know there are many of them on the dev forum, and I have looked at all of them but I have not been able to fix my issue. So the issue im having is the script works perfectly for 15 seconds, Then out of no where it breaks as shown in the video below, The Dragon Pet, Just randomly stops following me and will instead be locked in place.
https://gyazo.com/ba6cb1f467f05963ad9c022ef532f8b8
local CurrentPet = PetFolder:WaitForChild("Dragon"):Clone()
CurrentPet.Parent = workspace
CurrentPet:SetPrimaryPartCFrame(Character.PrimaryPart.CFrame)
Character.Humanoid.Died:Connect(function()
CurrentPet:Destroy()
end)
local Orien1 = Instance.new("Attachment")
Orien1.Parent = Character.HumanoidRootPart
local Orien0 = Instance.new("Attachment")
Orien0.Parent = CurrentPet.HumanoidRootPart
Orien0.Orientation = Vector3.new(0,90,0)
local attach1 = Instance.new("Attachment")
attach1.Parent = Character.HumanoidRootPart
local attach0 = Instance.new("Attachment")
attach0.Parent = CurrentPet.HumanoidRootPart
attach0.Position = Vector3.new(0,-3,-3)
local allign = Instance.new("AlignPosition")
allign.MaxForce = 30000
allign.Responsiveness = 40
allign.Attachment0 = attach0
allign.Attachment1 = attach1
allign.Parent = CurrentPet.HumanoidRootPart
local Ori = Instance.new("AlignOrientation")
Ori.Responsiveness = 40
Ori.Attachment0 = Orien0
Ori.Attachment1 = Orien1
Ori.Parent = CurrentPet.HumanoidRootPart