Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Animation.isPlaying

Switch to Manual
public var isPlaying: bool;

Description

Are we playing any animations?

var anim: Animation;

function Start() { anim = GetComponent.<Animation>(); }

// Plays an animation only if we are not playing it already. function OnMouseEnter() { if (!anim.isPlaying) anim.Play(); }