Hey I have this function which rigs my models however when I try to use “MoveTo” On it, the model isnt moving. I have confirmed the model is unanchored except for the body\
local function rigModel(petModel)
--[[
* Goal: Rig plain model using function for proper pathfinding.
* Actions: Create humanoid root part, humanoid, and weld it all.
--]]
-- HumanoidRootPart Creation
local humanoidRootPart = Instance.new("Part")
humanoidRootPart.Parent = petModel
humanoidRootPart.Name = "HumanoidRootPart"
humanoidRootPart.Size = Vector3.new(5,5,5)
humanoidRootPart.Transparency = 0.9
humanoidRootPart.Position = petModel:GetPivot().Position
humanoidRootPart.Anchored = false
petModel.PrimaryPart = humanoidRootPart
-- Weld everything
for i,v in pairs(petModel:GetChildren()) do
if v:IsA("BasePart") then
local weld = Instance.new("WeldConstraint")
weld.Parent = v
weld.Part0 = petModel.Body
weld.Part1 = v
v.Anchored = false
end
end
-- Humanoid Creation
local humanoid = Instance.new("Humanoid")
humanoid.Parent = petModel
-- So that it stays intact
petModel.Body.Anchored = true
end