#Basic Tweening

14 messages · Page 1 of 1 (latest)

thorny minnow
#
function tween(part, amount, newprops)
    local ts = game:GetService("TweenService")
    local ti = TweenInfo.new(amount)
    local tw = ts:Create(part, ti, newprops)
end

tween(part, 3, {Transparency = 1, Position = Vector3.new(0,0,0)})

sample function

#

just do tween(part, time, {property = value})

lean musk
#

you should atleast try to make a tweening script and ask for help here if you're stuck

thorny minnow
#

I just simplified it for him

lean musk
#

amount is also kinda misleading, that’s the speed

thorny minnow
#

Less input = easier for people who dont understand

thorny minnow
pliant pagoda
#

Like (tween:Tween)

#

I’ll do a example of that instead of doing a simple script

#

here is a example that i created and it worked```lua
local TextButton = script.Parent.TextButton
local TextLabel = script.Parent.TextLabel
local Tween = game:GetService('TweenService')
local function UpdateTween(text:TextLabel, tween:TweenService)
local NewLocation = UDim2.new(0.5, 0, 0.5, 0) -- set the new position to the center of the parent frame
local Tween = tween:Create(text, TweenInfo.new(1), {Position = NewLocation})
Tween:Play()
end

TextButton.MouseButton1Click:Connect(function()
UpdateTween(TextLabel, Tween)
end)```