Help again- opening a door using boxtrigger - anim does not play

Hello all’

I am a new user of Unity
I am trying to get a door to open when approached by a player
I have used a doorframe and door from a free dungeon package and tried to follow a tutorial from memory.

I have a C# script and I have debug.log statements to track what is working and whats not.
The door opens and closes when I det the variable in the animation window.
The script detects the trigger event and sets the variable but no animation happens.

I have probably missed some step.
Note: the anims and script and box collider are all attached to the door.
I realize that will move the collider when the door opens.

Thanks for assistance .
Here is the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Door_control : MonoBehaviour {
    Animator anim ;
    public bool p_door_open;

    // Use this for initialization
    void Start ()
    {
        Debug.Log ("Start");
        p_door_open = false;
        anim  = GetComponent<Animator>();
    }



    void OnTriggerEnter(Collider col)
    {
        Debug.Log ("collider enter");
        Debug.Log (col.gameObject.tag);
        if (col.gameObject.tag == "Player")
        {
            Debug.Log ("setting bool");
            p_door_open = true;
        }
    }
    void OnTriggerExit(Collider col)
    {
        Debug.Log ("collider exit");
    }

    // Update is called once per frame
    void Update () {
       
    }
}

You are referencing the animator correctly, but you are not using that reference to trigger the animator.

I had added in this bit
void OnTriggerExit(Collider col)
{
Debug.Log (“collider exit”);
p_door_open = false;
Doorsaction(“close”);
}

void Doorsaction(string direction)
{
Debug.Log (direction);
anim.SetTrigger(direction);

}

after reviewing the tutorial again, but I can seem to get it working properly.
I have made 3 doors and two of them head for outer space as soon as th game engine is started. The other stays put but does not work.

I have gone back to hand coding the game since I have zero progress for a week of work ;-(

Thanks for the reply.