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

Trying to create a ball socket constraint between two parts with a script, but it doesn't work?

Asked by
Nump4d 5
3 years ago
local dummy = game.Workspace.Dummy2 

if dummy then 
    local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
    a0.Name = "Attachment0"
    a1.Name = "Attachment1"
    a0.CFrame = game.Workspace.BSJ.CFrame
    a1.CFrame = dummy.Torso.CFrame
    a0.Parent = dummy.Torso
    a1.Parent = game.Workspace.BSJ

    local b = Instance.new("BallSocketConstraint")
    b.Attachment0 = a0
    b.Attachment1 = a1
    b.Parent = dummy.Torso
end

Here is my code. I am attempting to weld a part in workspace to the torso of an NPC. When I test the script, the ball socket and both attachments are at the same position in the workspace and are not in the torso nor the part.

0
Both attachments have to be in the same position. If they aren't then one of them will move to the other's position. radiant_Light203 1166 — 3y

Answer this question