Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Selectable.animator

Switch to Manual
public var animator: Animator;

Description

Convenience function to get the Animator component on the GameObject.

#pragma strict
// Required when Using UI elements.
private var buttonAnimator;
public var button;
function Start() {
	//Assigns the "buttonAnimator" with the button's animator.
	buttonAnimator = button.animator;
}