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

Constraints and Attachments, why won't they work?

Asked by 8 years ago

I'm trying to create hinge joints in between parts of a model below, and it shows the attachments, but there is no change, and no hinge movements going on. All the parts in the model are unanchored. I also tried attaching the first part of the chain to an anchored part via weld, but the first part just fell down with the rest of the chain. It makes no sense, any help is appreciated!

parts = game.Workspace.Parts:GetChildren();

start = parts[1].Position
finish = parts[#parts].Position + Vector3.new(0,5,0)

for i = 1, #parts do
    local part = parts[i]
    local attachmentA
    local attachmentB
    if(i < #parts) then
        attachmentA = Instance.new("Attachment", part) 
        attachmentA.Position = attachmentA.Position + Vector3.new(0, 0, -part.Size.z/2)
    end
    if(i > 1)then
        attachmentB = Instance.new("Attachment", part) 
        attachmentB.Position = attachmentB.Position + Vector3.new(0, 0, part.Size.z/2)
    end
    if((i > 1) and (i < #parts)) then
        local hingeConstraint = Instance.new("HingeConstraint", part)
        hingeConstraint.Attachment0 = attachmentA
        hingeConstraint.Attachment1 = attachmentB
    end
end

1 answer

Log in to vote
0
Answered by 8 years ago

If you look at the wiki page: http://wiki.roblox.com/index.php?title=API:Class/SpringConstraint

It will tell you at the top why. It has been disabled temporarily due to the iOS version having not been updated yet.

0
http://wiki.roblox.com/index.php?title=Joint <- doesn't say anything here... but ok dragonkeeper467 453 — 8y
Ad

Answer this question