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

Weld doesn't work for anchored parts?

Asked by
Lolnox 47
7 years ago

I'm creating an elevator for my game which moves using CFrame and consists of a few parts which must move together but weld doesn't seem to work with them as they are anchored. Any solution?

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Yep, make sure the model has a primary part set as you can use SetPrimaryPartCFrame() and it moves the whole model relative to the primary part.

Then you can do something like this.

local speed = 0.5

for i = 1, 100 do
    local currentCFrame = script.Parent:GetPrimaryPartCFrame()

    script.Parent:SetPrimaryPartCFrame(currentCFrame * CFrame.new(0,speed,0))

    wait()
end

Now go to my question and help me about colors :3

0
It works! Thank you! Lolnox 47 — 7y
Ad

Answer this question