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

How do I tween models? I don't understand.

Asked by 5 years ago

How do I get this to tween? I don't really understand this.

local tweenService = game:GetService("TweenService")
local info = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
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(model, info, {CFrame = CFrame.new(0,0,-48.8)})
    tween:Play()


    tween.Completed:Connect(function()
        CFrameValue:Destroy()
    end)
end
0
lerp the model theking48989987 2147 — 5y
0
???? voidofdeathfire 148 — 5y
0
tweenModel(Your_Target_Model, Ending CFrame) (change line 11 {CFrame = CF}) User#26586 0 — 5y

Answer this question