How do I call an animation in a C# script?

Hey, so I need to call an animation of a door opening in C#, and I tried coping the format that unity did for the 3rd person controller with this:

public class DoorType : MonoBehaviour {
 	public var doorUp : AnimationClip;

so from there I got a parser error saying that : was unexpected.
Thanks in advance!

public AnimationClip doorUp;

You are mixing c# and Javascript in the same code. That’s wrong. You probably want:

public class DoorType : MonoBehaviour {
    public AnimationClip doorUp;