TweenService
Used to create Tweens which interpolate, or tween, the properties of instances.
Memory category | Instances |
---|
Member index 3
Description
TweenService is used to create Tweens which interpolate, or tween, the properties of instances. Tweens can be used on any object with compatible property types, including:
TweenService:Create(), the primary constructor function, takes TweenInfo specifications about the tween and generates the Tween object which can then be used to play the tween.
Note that Tweens can interpolate multiple properties at the same time, but they must not be interpolating the same property. If two tweens attempt to modify the same property, the initial tween will be cancelled and overwritten by the most recent tween.
History 7
Members 3
Create
Parameters (3) | ||
---|---|---|
instance | Instance | |
tweenInfo | TweenInfo | |
propertyTable | Dictionary | |
Returns (1) | ||
Tween |
This constructor creates a new Tween from three arguments: the object to tween, the TweenInfo specifications, and a table containing the properties to tween and values to tween to.
The propertyTable
parameter needs to be a dictionary where the keys are
the string names of the property (for example Position
, Transparency
,
or Color
), and the values are the property targets at the end of the
tween.
The Tween created using this function is unique to the object
given as the instance
parameter. To apply the same tween to another
object, call this function again with the new object.
Thread safety | Unsafe |
---|
GetValue
Parameters (3) | ||
---|---|---|
alpha | float | |
easingStyle | EasingStyle | |
easingDirection | EasingDirection | |
Returns (1) | ||
float |
Returns a new alpha value for interpolating using the given alpha value,
EasingStyle, and EasingDirection. The provided alpha
value
will be clamped between 0
and 1
.
Thread safety | Unsafe |
---|
SmoothDamp
Parameters (6) | ||
---|---|---|
current | Variant | |
target | Variant | |
velocity | Variant | |
smoothTime | float | |
maxSpeed | float? | |
dt | float? | |
Returns (2) | ||
Variant | ||
Variant |
Returns a value that allows smoothing a value towards a target simulating a critically damped spring. Supports Vector2, Vector3, and CFrame, and number.
Thread safety | Unsafe |
---|
History 1
- 636 Add SmoothDamp