Service · inherits Instance
TweenService
Used to create Tweens which interpolate, or tween, the
properties of instances.
About TweenService
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.
Methods 3
Create
(instance: Instance, tweenInfo: TweenInfo, propertyTable: Dictionary) → TweenCreates a newTweengiven the object whose properties are to be tweened, aTweenInfo, and a dictionary of goal property values.This constructor creates a new
Tweenfrom three arguments: the object to tween, theTweenInfospecifications, and a table containing the properties to tween and values to tween to.The
propertyTableparameter needs to be a dictionary where the keys are the string names of the property (for examplePosition,Transparency, orColor), and the values are the property targets at the end of the tween.The
Tweencreated using this function is unique to the object given as theinstanceparameter. To apply the same tween to another object, call this function again with the new object.GetValue
(alpha: float, easingStyle: EasingStyle, easingDirection: EasingDirection) → floatCalculates a new alpha given anEasingStyleandEasingDirection.Returns a new alpha value for interpolating using the given alpha value,
EasingStyle, andEasingDirection. The providedalphavalue will be clamped between0and1.SmoothDamp
(current: Variant, target: Variant, velocity: Variant, smoothTime: float, maxSpeed: float?, dt: float?) → TupleSmoothly interpolates a value towards a target, simulating a critically damped spring.
TweenService also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.