Class · inherits Instance
TweenBase
About TweenBase
Abstract base class for in-between interpolation handlers; parent class of
Tween.
Properties 1
PlaybackState
: PlaybackStateReadOnlyNotReplicatedRead-only property that shows the current state for theTweenanimation.Read-only property that shows the current stage for the
Tweenanimation. SeePlaybackStatefor descriptions of each state. Change using functions likeTween.Play.
Methods 3
Cancel
() → ()Halts playback and resets the tween variables. If you then callTweenBase.Play, the properties of the tween resume interpolating towards their destination, but take the full length of the animation to do so.Halts playback of a
Tweenand resets the tween variables.Only resets the tween variables, not the properties being changed by the tween. If you cancel a tween halfway through its animation, the properties do not reset to their original values. Differs from
TweenBase.Pausein that once resumed, it takes the full duration of the tween to complete the animation.Pause
() → ()Halts playback of the tween. Doesn't reset its progress variables, meaning that if you callTweenBase.Play, the tween resumes playback from the moment it was paused.Halts playback of the tween. Doesn't reset its progress variables, meaning that if you call
TweenBase.Play, the tween resumes playback from the moment it was paused.If you want to reset the progress variables of the tween, use
TweenBase.Cancel.You can only pause tweens that are in the
PlaybackStateofEnum. PlaybackState.Playing; tweens in other states won't pause. If a tween is in a differentPlaybackStatesuch asEnum. PlaybackState.Delayed(as a result of itsTweenInfo.DelayTimebeing greater than 0), attempting to pause the tween will fail and the tween will play following its specified delay time.Play
() → ()Starts playback of a tween. Note that if playback has already started, callingPlay()has no effect unless the tween has finished or is stopped (either byTweenBase.CancelorTweenBase.Pause).Starts playback of a tween. Note that if playback has already started, calling
Play()has no effect unless the tween has finished or is stopped (either byTweenBase.CancelorTweenBase.Pause).Multiple tweens can be played on the same object at the same time, but they must not animate the same property. If two tweens attempt to modify the same property, the initial tween is cancelled and overwritten by the most recent tween (see examples).
Events 1
Completed
TweenBase.Completed:Connect(function(playbackState))Fires when the tween finishes playing or when stopped withTweenBase.Cancel.Fires when the tween finishes playing or when stopped with
TweenBase.Cancel.Passes the
PlaybackStateof the tween to any connected functions to give an indication of why the tween ended. Note that callingTweenBase.Pausedoes not fire theCompletedevent.
TweenBase 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.