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

How can we tween an attached part?

Asked by 4 years ago
Edited 4 years ago

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

0
You could get it's CFrame offset and CFrame it to the tweened part's CFrame times the offset mybituploads 304 — 4y
0
You don't. Tweening doesn't calculate for physics when using CFrame. Fifkee 2017 — 4y
0
you maybe could use primary parts 123nabilben123 499 — 4y
0
attachments cannot be in a model TheRealPotatoChips 793 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question