How to start an animation?

  • Hello all Unities,

           I want to know how to start an animation with a keyboard
    
    

    button, what are the basic requirement to make an imported model do animation? The reason I asking because Unity gave me that response so made me confusing...

    Assets/Alien1.js(6,14): BCE0005: Unknown identifier: 'GetButtonDown'.

    I also wondering why are my imported model shrinked when the animation is playing?

    Please let me know how to fix these problems.

    Cheers.

Give the same scale to all your animations from the project window so they are at the same size with your main mesh.

if (Input.GetKey (KeyCode.Space)){
    animation.Play("Your Animation Name Here");
}