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.isPlaying

Switch to Manual
public bool isPlaying;

Description

Are we playing any animations?

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Animation anim; void Start() { anim = GetComponent<Animation>(); } void OnMouseEnter() { if (!anim.isPlaying) anim.Play(); } }