• Studio

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • AnimationCurve

    The AnimationCurve class represents a curve that defines the interpolation between keyframes over time. It's commonly used in animation systems to define smooth transitions between different values over time.

    Properties

    length

    number

    The number of keys in the curve. (Read Only)

    Methods

    Interpolates the value from the curve at a given time point. The curve is evaluated, giving the value of the curve at that exact time. This becomes very handy when lerping between two values in a non-linear way for smoother transitions.

    Parameters

    time

    number

    The time at which to evaluate the curve.

    Returns

    number

    Returns the value of the curve at the specified time.

    Tool designed to insert a new key into your AnimationCurve. A way to dynamically shape your animation by adding keyframes at certain times with specific values.

    Parameters

    time

    number

    The time at which the new key should be inserted.

    value

    number

    The value of the new key at the specified time.

    Returns

    number

    Returns the index of the added key, or of the existing key if one already exists at the given time.

    Erase all keys from the AnimationCurve. It can be beneficial when you need to reset the curve or want to dynamically generate a new one.

    Returns

    void

    This method does not return a value.

    Removes the key at a specified index from your AnimationCurve. Varying curves dynamically can lead to interesting gameplay possibilities and variation in animations.

    Parameters

    index

    number

    The index of the key you want to remove.

    Returns

    void

    This method does not return a value.

    Updates the tangent of a key in the AnimationCurve to create a smooth transition in the curve. This becomes essential while crafting natural and organic animations.

    Parameters

    index

    number

    The index of the key to update.

    weight

    number

    How much influence the tangent has. A weight of 0 will make the tangent flat.

    Returns

    void

    This method does not return a value.

    Copies all settings, including all keys from the given curve. This can prove useful when you want to duplicate the behavior of an existing curve.

    Parameters

    The source AnimationCurve to copy from.

    Returns

    void

    This method does not return a value.

    Creates a new AnimationCurve where all values are the same (constant). This can come in handy when creating a stable, unchanging behavior.

    Parameters

    timeStart

    number

    The starting time of the curve.

    timeEnd

    number

    The ending time of the curve.

    value

    number

    The constant value for the curve.

    Returns

    AnimationCurve

    Returns a new AnimationCurve with a constant value.

    Creates a new AnimationCurve representing a linear interpolation between a start and end value (valueStart and valueEnd) over a specified time period (timeStart to timeEnd). This is particularly useful when a linear transition between two states is required over a given duration.

    Parameters

    timeStart

    number

    The starting time of the curve.

    valueStart

    number

    The value of the curve at the start time.

    timeEnd

    number

    The ending time of the curve.

    valueEnd

    number

    The value of the curve at the end time.

    Returns

    AnimationCurve

    Returns a new AnimationCurve representing a linear interpolation.

    Creates a new AnimationCurve that smoothly transitions between the start and end values over a specified time period. This method is especially useful to create animations with smooth starts and ends, providing a more natural look.

    Parameters

    timeStart

    number

    The starting time of the curve.

    valueStart

    number

    The value of the curve at the start time.

    timeEnd

    number

    The ending time of the curve.

    valueEnd

    number

    The value of the curve at the end time.

    Returns

    AnimationCurve

    Returns a new AnimationCurve with smooth transitions at start and end.

    Updated 4 months ago

    PocketWorlds Icon

    © 2024 Pocket Worlds. All rights reserved.