Legacy Documentation: Version 5.5
LanguageEnglish
  • C#
  • JS

Script language

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

Animation.clip

Switch to Manual
public AnimationClip clip;

Description

The default animation.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Animation anim; IEnumerator Start() { anim = GetComponent<Animation>(); anim.Play(anim.clip.name); yield return new WaitForSeconds(anim.clip.length); } }