• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Tween

    Tween object for creating smooth animations and transitions. Tween objects are used to create smooth animations and transitions between values. They can be used to animate properties of objects, such as position, scale, rotation, and color. Tweens can be played, paused, stopped, and updated. They can also be delayed, looped, and ping-ponged. Easing functions can be applied to tweens to create different effects, such as acceleration and deceleration. Tweens can be created using the Tween.new method.

    Properties

    duration

    number
    ClientOnly
    ReadOnly

    Returns the tween duration in seconds. Note that zero will be returned if the tween is not playing.

    isAnyTweenAnimating

    boolean
    ClientOnly
    ReadOnly

    Returns true if any tween is currently animating.

    isPaused

    boolean
    ClientOnly
    ReadOnly

    Returns true if the tween is currently paused

    isPlaying

    boolean
    ClientOnly
    ReadOnly

    Returns true if the tween is valid and currently playing. Note that false will always be returned for Element tweens as the play state is managed by the top level collection tween.

    isValid

    boolean
    ClientOnly
    ReadOnly

    Returns true if the tween has not been stopped

    normalizedTime

    number
    ClientOnly
    ReadOnly

    Get the current elapsed time using a normalized time of 0-1

    time

    number
    ClientOnly
    ReadOnly

    Get current elapsed time in seconds.

    Methods

    AddDelay

    ClientOnly

    Add a number of seconds to the existing delay amount. If the value added decreases the delay below zero the it will be set to zero.

    Parameters

    seconds
    number

    Returns

    AutoStop

    ClientOnly

    Whether or not the tween should automatically stop itself when the float Tween.time is greater or equal to the float Tween.duration

    Note that a tween set to not auto stop will never end until manually stopped.

    Parameters

    value
    boolean
    optional

    Returns

    Set the tween to automatically deactivate the GameObject attached to the target when the Tween stops

    Parameters

    value
    boolean
    optional

    Returns

    Delay

    ClientOnly

    Amount of time to wait before starting the tween.

    Note that the OnStart method will not be called until after the delay.

    When Delay is used on a looping tween the delay is only applied once and not on each loop.

    Parameters

    seconds
    number

    Delay in seconds

    Returns

    DestroyOnStop

    ClientOnly

    Set the tween to automatically destroy the GameObject attached to the target when the Tween stops

    Parameters

    value
    boolean
    optional

    Returns

    DisableOnStop

    ClientOnly

    Automatically disable the target Component when the Tween stops

    Parameters

    value
    boolean
    optional

    Returns

    Duration

    ClientOnly

    Set the duration in seconds of the tween.

    Using the Duration modifier on either a Sequence or a Group will cause the duration of all elements to be overridden with the given duration.

    Parameters

    seconds
    number

    Duration in seconds

    Returns

    EaseIn

    ClientOnly

    Ease in using the given easing function

    Parameters

    easeDelegate
    (normalizedTime: number, param: Vector4) -> (number)

    Delegate to use for easing int

    Returns

    EaseIn

    ClientOnly

    Ease in using the given easing function

    Parameters

    easeDelegate
    (normalizedTime: number, param: Vector4) -> (number)

    Delegate to use for easing int

    param

    Returns

    EaseInBack

    ClientOnly

    Applies an ease-in back easing function to the tween. This function overshoots the target value before settling into place.

    Parameters

    amplitude
    number
    optional

    Returns

    EaseInBounce

    ClientOnly

    Applies an ease-in bounce easing function to the tween. This function creates a bouncing effect.

    Parameters

    oscillations
    number
    optional
    springiness
    number
    optional

    Returns

    EaseInCircle

    ClientOnly

    Applies an ease-in circle easing function to the tween. This function accelerates the tween animation.

    Returns

    EaseInCubic

    ClientOnly

    Ease in using Cubic interpolation

    Returns

    Applies an ease-in cubic Bezier easing function to the tween. This function accelerates the tween animation.

    Parameters

    p0
    number
    p1
    number
    p2
    number
    p3
    number

    Returns

    EaseInElastic

    ClientOnly

    Applies an ease-in elastic easing function to the tween. This function creates a spring-like effect.

    Parameters

    oscillations
    number
    optional
    springiness
    number
    optional

    Returns

    Applies an ease-in exponential easing function to the tween. This function accelerates the tween animation.

    Parameters

    exponent
    number
    optional

    Returns

    EaseInOutBack

    ClientOnly

    Applies an ease-in-out back easing function to the tween. This function overshoots the target value before settling into place.

    Parameters

    amplitude
    number
    optional

    Returns

    EaseInOutBounce

    ClientOnly

    Applies an ease-in-out bounce easing function to the tween. This function creates a bouncing effect.

    Parameters

    oscillations
    number
    optional
    springiness
    number
    optional

    Returns

    EaseInOutCircle

    ClientOnly

    Applies an ease-in-out circle easing function to the tween. This function accelerates and decelerates the tween animation.

    Returns

    EaseInOutCubic

    ClientOnly

    Ease in and out using Cubic interpolation

    Returns

    Applies an ease-in-out cubic Bezier easing function to the tween. This function accelerates and decelerates the tween animation.

    Parameters

    p0
    number
    p1
    number
    p2
    number
    p3
    number

    Returns

    Applies an ease-in-out elastic easing function to the tween. This function creates a spring-like effect.

    Parameters

    oscillations
    number
    optional
    springiness
    number
    optional

    Returns

    Applies an ease-in-out exponential easing function to the tween. This function accelerates and decelerates the tween animation.

    Parameters

    exponent
    number
    optional

    Returns

    Ease in and out using Quadratic interpolation

    Returns

    EaseInOutSine

    ClientOnly

    Applies an ease-in-out sine easing function to the tween. This function accelerates and decelerates the tween animation.

    Returns

    EaseInQuadratic

    ClientOnly

    Ease in using Quadratic interpolation

    Returns

    EaseInSine

    ClientOnly

    Applies an ease-in sine easing function to the tween. This function accelerates the tween animation.

    Returns

    EaseOut

    ClientOnly

    Ease out using the given easing function

    Parameters

    easeDelegate
    (normalizedTime: number, param: Vector4) -> (number)

    Delegate to use for easing out

    Returns

    EaseOut

    ClientOnly

    Ease out using the given easing function

    Parameters

    easeDelegate
    (normalizedTime: number, param: Vector4) -> (number)

    Delegate to use for easing out

    easeParams

    Optional easing paramters

    Returns

    EaseOutBack

    ClientOnly

    Applies an ease-out back easing function to the tween. This function overshoots the target value before settling into place.

    Parameters

    amplitude
    number
    optional

    Returns

    EaseOutBounce

    ClientOnly

    Applies an ease-out bounce easing function to the tween. This function creates a bouncing effect.

    Parameters

    oscillations
    number
    optional
    springiness
    number
    optional

    Returns

    EaseOutCircle

    ClientOnly

    Applies an ease-out circle easing function to the tween. This function decelerates the tween animation.

    Returns

    EaseOutCubic

    ClientOnly

    Ease Out using Cubic interpolation

    Returns

    Applies an ease-out cubic Bezier easing function to the tween. This function decelerates the tween animation.

    Parameters

    p0
    number
    p1
    number
    p2
    number
    p3
    number

    Returns

    EaseOutElastic

    ClientOnly

    Applies an ease-out elastic easing function to the tween. This function creates a spring-like effect.

    Parameters

    oscillations
    number
    optional
    springiness
    number
    optional

    Returns

    Applies an ease-out exponential easing function to the tween. This function decelerates the tween animation.

    Parameters

    exponent
    number
    optional

    Returns

    Ease Out using Quadratic interpolation

    Returns

    EaseOutSine

    ClientOnly

    Applies an ease-out sine easing function to the tween. This function decelerates the tween animation.

    Returns

    Element

    ClientOnly

    Adds an element to a Sequext or Group tween

    Parameters

    element

    element to add

    Returns

    From

    ClientOnly

    Switch the tween to start the configured 'from' value and end at the current value

    Returns

    Id

    ClientOnly

    Set a unique identifier for the tween. Setting a unique identifier value of zero indicates that a tween has no identifier.

    Parameters

    id
    number

    Unique identier

    Returns

    Loop

    ClientOnly

    Loop the tween

    Parameters

    count
    number
    optional

    Number of loops or -1 to loop forever

    Returns

    OnPlay

    ClientOnly

    Callback to invoke when the Tween starts playing and the delay is finished

    Parameters

    callback
    () -> ()

    Action

    Returns

    OnStop

    ClientOnly

    Callback to invoke when the Tween is stopped

    Note that the OnStop callback may not be called if the tween is stopped using an executeCallbacks value of false.

    Parameters

    callback
    () -> ()

    Action

    Returns

    Pause

    ClientOnly

    Pause the tween until either Play is called again or the tween is stopped

    Returns

    void

    PingPong

    ClientOnly

    Enables or PingPong mode.

    Returns

    PingPong

    ClientOnly

    Enables or PingPong mode.

    Parameters

    value
    boolean

    Returns

    Play

    ClientOnly

    Start the tween playing. Note that once a tween begins playing it can no longer me modified.

    Returns

    Priority

    ClientOnly

    Sets a user defined value that indicates the priority of the tween. This priority is then used in Tween.Frame to allow the application to determine the max priority being run

    Parameters

    priority
    number

    Returns

    Reset

    ClientOnly

    Call to completely reset the tween system by stopping all running tweens, clearing all the caches, and stopping the updater

    Returns

    void

    Stop

    ClientOnly

    Stop all tweens running on a target object

    Parameters

    id
    number

    Optional identifier to filter by (0 = no identifier)

    executeCallbacks
    boolean
    optional

    True if any remaining callbacks such as OnStop should be called (Default true)

    Returns

    void

    Stop

    ClientOnly

    Stop all tweens running on a target object

    Parameters

    executeCallbacks
    boolean
    optional

    True if any remaining callbacks such as OnStop should be called (Default true)

    Returns

    void

    StopAll

    ClientOnly

    Stop all playing tweens

    Parameters

    executeCallbacks
    boolean
    optional

    Returns

    void

    UnscaledTime

    ClientOnly

    Sets the animation to use unscaled time rather than normal scaled time

    Parameters

    unscaled
    boolean
    optional

    True to use unscaled time

    Returns

    Update

    ClientOnly

    Manually update the tween by adding the given amount of delta time

    Parameters

    deltaTime
    number

    Returns

    boolean

    True if the tween is still running

    Updated 4 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.