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

How do I move parts that are welded?

Asked by 5 years ago

tween moving script here, below is the Weld:

local TweenService = game:GetService("TweenService")
local door2 = script.Parent.IslandHolder
local tweeningInformation = TweenInfo.new(
    5,   
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
local door2Open = {CFrame = CFrame.new(-91.5, -10, 12.75)}
local door2Close = {CFrame = CFrame.new(-91.5, -7, 12.75)}
local tween2open = TweenService:Create(door2,tweeningInformation,door2Open)
local tween2close = TweenService:Create(door2,tweeningInformation,door2Close)

while wait(0.1) do
    tween2open:Play()
    wait(5)
    tween2close:Play()
    wait(5)
end

-------- Weld

local function weldBetween(a, b)
    local weld = weldBetween(script.Parent.IslandHolder, script.Parent:GetChildren("Part"))
    weld.C0 = a.CFrame:inverse() * b.CFrame
    weld.Part0 = a
    weld.Part1 = b
    return weld
end

I don't get how these won't weld and follow while the main part is going up/down. I mean the Tweening works, and I don't feel the Weld works, but is there a way to make the welds move too? (two seperate scripts)

0
Don't use wait() as your loop's condition; it's a hack. User#19524 175 — 5y
0
@incapaz, why not? Leamir 3138 — 5y

1 answer

Log in to vote
-1
Answered by 5 years ago

dear MarkHasReset,

try lerping

TheluaBanana

0
Use comments. User#19524 175 — 5y
0
@incapaz, why not? TheluaBanana 946 — 5y
0
I see what you mean but please explain more next time. I will try linear interpolation now. MarkHasReset 77 — 5y
Ad

Answer this question