Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I move parts that are welded?

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)

2 comments

0

Don't use wait() as your loop's condition; it's a hack.

0

@incapaz, why not?

1 answer

✓ Accepted answer

dear MarkHasReset,

try lerping

TheluaBanana

3 comments

0

Use comments.

0

@incapaz, why not?

0

I see what you mean but please explain more next time. I will try linear interpolation now.

This discussion is preserved as it was. New answers, comments, and votes are closed.