Skip to content

care.anim.Instance.new

Function

Creates a new instance of an animation.

Creates a new instance of the animation provided by a care.anim.Animation object.

Syntax

animation = care.anim.Instance.new(anim, repeats, speed, on_complete)

Arguments

Name Type Description
anim care.anim.Animation Reference animation that this instance plays.
repeats boolean (Optional) Whether the animation repeats after completion (or otherwise is deleted). Defaults to false if not specified.
speed number (Optional) Playback speed of the animation, measured in seconds per frame. If not specified, the default speed specified in the care.anim.Animation object will be used.
on_complete function (Optional) Function called upon completion of this instance of the animation (after the on_complete callback of its associated care.anim.Animation).

Returns

Name Type Description
animation care.anim.Animation The newly created animation object.

Example

TODO