Open door as Character approaches

So I can not for the life of me figure out how to make a door move out of the way when I am walking up to it.

I watched this as a base but I think it is kinda throwing me off. I got the animations to sorta work but they the door is just moving up and down all the time. Maybe i should just make this more simple and uses forces and stuff instead of animations but this should be the easier way if I can just figure it out.

My set up right now it as fallows.

A door trigger with my script, rigid body and animation attached.
Then a door (cube) with its mesh intact parented to the trigger.

Code I have used: (in c#)

using UnityEngine;
using System.Collections;

    public class DoorOpener : MonoBehaviour {
    
	private HashIDs hash;      
	private Animator anim;
	private GameObject player;
	private int count;  

	void Awake ()
	{
		// Setting up the references.
		anim = GetComponent<Animator>();
		hash = GameObject.FindGameObjectWithTag("GameController").GetComponent<HashIDs>();
		player = GameObject.FindGameObjectWithTag("Player");
	}
	void OnTriggerEnter(Collider other) 
	{
				if (other.gameObject == player) {
						count++;
			Debug.Log ("OPEN");
				}
		}
		void OnTriggerExit (Collider other)
		{
			if(other.gameObject == player) {
				count = Mathf.Max(0, count-1);
			Debug.Log ("CLOSE");
			}
		}
		void Update ()
		{
			anim.SetBool(hash.openBool,count > 0);
		}
}

Also a hashID script to go along with that,
Sorry for any sloppy coding syntax

Any ideas? thanks, kindling bugging me that I can’t figure this out

The door uses Mecanim?

Seems a little much for a door, a simple rotate or move would be more efficient.

Did you add your parameters to the transitions?

If you have just Open and Close in your state machine, add a third Empty State and make it default. Provide your transitions from this empty.

I did this following a tutorial, is this what you are looking for?
I’m incredibly noob at this coding stuff, and your code for me looks extremely confusing.

{

	bool doorIsOpen = false;
	float doorTimer = 0.0f;
	public float doorOpenTime = 3.0f;
	public AudioClip doorOpenSound;
	public AudioClip doorShutSound;

	void Start(){
		doorTimer = 0.0f;
	}
	void Update(){
				if (doorIsOpen) {
						doorTimer += Time.deltaTime;
						if (doorTimer > doorOpenTime) {
								Door (doorShutSound, false, "doorshut");
								doorTimer = 0.0f;
						}
				}
		}

	void DoorCheck(){
		if(!doorIsOpen){
			Door(doorOpenSound, true, "dooropen");
		}
	}

	void Door(AudioClip aClip, bool openCheck, string animName){
		audio.PlayOneShot(aClip);
		doorIsOpen = openCheck;
		transform.parent.gameObject.animation.Play(animName);
	}
}

This code is pretty simple, I have 3 animations on the door, an IDLE an Open and Close animation. And the rest I think it’s self explained, but if you have any doubt I’ll walk you through…