Someone in my project has made a model to replace with a basic AI. I've easily welded all the parts to a "torso" in the model, a centre part. However, whenever I attempt to weld this torso part to anything such as the HumanoidRootPart the AI will get very buggy. Glitching, teleporting, ect.
Details - All the parts inside the model have CanCollide set to false and none are anchored.
Here's the welding script..
torso = script.Parent:WaitForChild("Torso")
torso = script.Parent:WaitForChild("Torso") for _,v in ipairs(script.Parent:GetDescendants()) do if v:IsA("Part") or v:IsA("UnionOperation") or v:IsA("WedgePart") then if v.Name ~= "Torso" then local weld = Instance.new("Weld") weld.Parent = v weld.Part0 = torso weld.Part1 = v weld.C0 = torso.CFrame:inverse() weld.C1 = v.CFrame:inverse() v.CanCollide = false wait() v.Anchored = false elseif v.Name == "Torso" then local weld = Instance.new("Weld") weld.Parent = v weld.Part0 = script.Parent.Parent.RightHand weld.Part1 = v weld.C0 = torso.CFrame:inverse() weld.C1 = v.CFrame:inverse() end end end
Would appreciate any feedback possible :D
Resolved my issue, failed to be specific and people thought I was trying to call "Torso" in an R15 rig. This wasn't the case, I was, in the most horrible way possible creating a custom AI character. Moved on and resolved this issue by simply making a rig from scratch and not trying to bind it to an invisible rig. Take this as a lesson as what NOT to do :D