Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problem welding a model to a AI?

Asked by 6 years ago

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

0
you use r15? taunter165 30 — 6y
0
what do u think it has torso not uppertorso hiimgoodpack 2009 — 6y
0
No, it's R15. The 'Torso' is the name of the centre part of the model. shadowrebeller 0 — 6y
0
r15 dosnt have a torso insted it has a upper and lower torso KFCPhoeyu 41 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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

Ad

Answer this question