Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AnimationClip.length

Switch to Manual
public var length: float;

Description

Animation length in seconds. (Read Only)

var anim: Animation;

function Start() { anim = GetComponent.<Animation>(); anim.Play(); // Wait for the animation to finish. yield WaitForSeconds(anim.clip.length); }