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

How do I tween a model? I have this so far.

Asked by 3 years ago

`local tweenService = game:GetService("TweenService") local info = TweenInfo.new()

local function tweenModel(model, CF) local CFrameValue = Instance.new("CFrameValue") CFrameValue.Value = model:GetPrimaryPartCFrame()

CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
    model:SetPrimaryPartCFrame(CFrameValue.Value)
end)

local tween = tweenService:Create(CFrameValue, info, {Value = CF})
tween:Play()

tween.Completed:connect(function()
    CFrameValue:Destroy()
end)

end

tweenModel(script.Parent, game.Workspace.To.CFrame)`

It brings it to the location but doesn't tween to it.

1 answer

Log in to vote
0
Answered by
zadobyte 692 Moderation Voter
3 years ago

Have you tried filling a time out to your TweenInfo?

2
im confused as to why this isnt a comment xd greatneil80 2647 — 3y
0
IKR Wow you joined Roblox a while ago, 7 years ago in 2013 goodlead -62 — 3y
0
I tried everything. I’m semi-new to scripting, so I was wondering if anyone can help me like with an example that can work in this situation that I want for it to happen. WoofWoofWatermelonYT 16 — 3y
0
WOW YOU joined Roblox a while ago, 4 years ago in 2016 goodlead -62 — 3y
Ad

Answer this question