can't play simple animation

I’ve been searching the web for 4 hours but I still haven’t figured out how to play a single #*!$#-ing animation on my GameObject. Help pls…

using UnityEngine;
using System.Collections;

public class DuelPlayerControllerX : MonoBehaviour 
{

	/*
	public AnimationClip attackTwoAnimation;
	public AnimationClip attackThreeAnimation;
	public AnimationClip dieOneAnimation;
	public AnimationClip dieTwoAnimation;*/
	public AnimationClip attackOneAnimation;



void  Awake ()
{
	
}


void  Update ()
{
	
		if(Input.GetKeyDown (KeyCode.U))
		{
			Debug.Log ("U key pushed");
			animation.Play("attackOneAnimation");
		}

		
}

}

Check that play on awake is not checked for your animations, as you are triggering them via code. Also check that the animations are set to loop (assuming you want to do this) from the import settings.

I dropped your script on a simple door of mine. -Fonted as Code Sample so you can read this easier without me spending 20 minutes editing it, none of this is code ;)-

Here are the settings I have (it plays just fine, as many times as I press ‘U’)

Inspector components

Make sure your script is added to the object with the animations. The animations will be on the parent of the fbx file, so must the script be included there. You should see the animations next to Elements, the name there must match your script.

Play Auto- doesnt matter
Animate physics (mine are off)

culling type - always animate (mine is set to this, you may need it based on renders depending on what you’re doing.)

Import settings:
-RIG-
Animation Type: Legacy
Generation: Stored in Root (deprecated)

-Animations-
Import ani - check
Wrap mode- default
anim. compreeesion - keyframe reduction
errors all set to .5

clips
-----
names with start to end. (door_open) is the name of the animation, so in script
animation.Play("door_open");

Add loop frame - unchecked
wrap mode - default

If that doesn’t work there is an issue with the export. Go back to maya/max/blender and re-export it and make sure the settings there are correct (such as animations being checked and the right amount of keyframes.

Also try adding a different object with a simple animation on it (cube rotating) and try it. Just to make sure it isn’t an issue with your editor.

Good luck!