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

How can we tween an attached part?

Is it possible to tween a part that has been attached to another part by attachments? And if yes, how? Thanks.

4 comments

0

You could get it's CFrame offset and CFrame it to the tweened part's CFrame times the offset

0

You don't. Tweening doesn't calculate for physics when using CFrame.

0

you maybe could use primary parts

0

attachments cannot be in a model

1 answer

No clue if this would work, never got in a situation where i'd need this

--If the part doesn't need the attachment's physics then this should work

local partA,partB = workspace.Part1,workspace.Part2
local offset = partA.CFrame:ToObjectSpace(partB.CFrame)

partB.Anchored = true
game.TweenService:Create(partA,TweenInfo.new(1),{CFrame = CFrame.new(10,5,1)}):Play()


local connect = game:GetService("RunService").Stepped:Connect(function()
	partB.CFrame = partA.CFrame * offset
end)

wait(1)

connect:Disconnect()
partB.Anchored = false

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