Skip to content

Format

typescript
AnimationClip.length

class: AnimationClip

Description

The length of the current animation clip.

It represents the duration of the animation clip, which is the time it takes for the animation to play from start to finish, in seconds.

Parameters

param_nametypedescription

Return

typedescription
numberThe length of the animation clip.

Code Example

typescript
let obj = new GameObject();
let animation = obj.AddComponent<Animation>(Animation);
let uuid = "31A9092E126B4B19BBFD9D5FCD75AA49";
let clip = Resources.Load<AnimationClip>(AnimationClip, uuid);
let len = clip.length;