how to activate an animation with a key

i want to attack and activate a animation, but i have no idea how to do that.

http://unity3d.com/support/documentation/ScriptReference/Animation.Play.html

1 Answer

1

Yes, just as OrangeLightning said use Animation.Play. So something along the lines of this:

if (Input.GetKeyDown(KeyCode.WhateverKeyYouWantToUse)) {
animation.Play();
}

Good luck! Klep