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

What do I put for TweenService 2nd Argument?

Asked by 4 years ago
script.Parent.MouseLeave:Connect(function()
    TweenService:Create(script.Parent, argument, {ImageColor3 = Color3.fromRGB(138, 138, 138)})
end)

I need help, I don't know what to put for the 2nd argument on this script, as I've forgotten a bit of lua. I'd appreciate it if someone helped me.

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You need TweenInfo. Having TweenInfo.new() means you would be using the defaults. More info on TweenInfo here.

Here's an example:

local tweenService = game:GetService("TweenService");
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Quad, -- the easing style
Enum.EasingDirection.InOut, -- easing direction
0, -- repeat count
false, -- reverses or not
0 -- delay amount before starting
);
local goal = {
Size = Vector3.new(10, 10, 10);
}
local tween = tweenService:Create(workspace.Part, tweenInfo, goal);
tween:Play();

If you would like to see how EasingStyles look, I suggest TweenSequence Editor plugin, which can be found here.

Ad

Answer this question