Need help with simple Door trigger

I’m trying to make a door can be trigger by a power switch. But it keeps playing the animation at the start of the level.

This is the script for the door.

public Animation anim;

void Start()
{
anim = GetComponent ();

}

void Update()
{
if(GameVariable.electCount > 1)
{

anim.Play(“FinalDoor”);
}
}
}

This is the script for the trigger.

//player trigger final door
void OnTriggerEnter (Collider other)
{
if (other.tag == “Player”)
{
GameVariable.electCount +=1;
}

}
}

This is a script for variable

public static class GameVariable {
public static int electCount;
}

On your Door object, look for “Animation” Component and uncheck “Play automatically”

Hope this helps

~N3rk