Animation Collision

Hi!
I made a simple animation script, but it doesn’t work.
What i want is that when i enter the collision, i want my animation to play after a delay of 5 seconds wich doesn’t repeat itself every time the animation is done. I am pretty bad at coding, so if someone could tell me how to achieve this, i’d REALLY love that!

Thank you.

the animation trigger script (c#) :

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

public class Screen_Fade : MonoBehaviour {

public Animator anim;

public string MyTrigger { get; private set; }

private void Start()
{

}
void OnCollisionEnter2D(Collision2D col)
{

    if (col.gameObject.name.Equals("The object with the collision"))
    {
        GetComponent<Animator>().SetTrigger(MyTrigger);
    }

}
}

Hi, so I’m pretty sure you can accomplish what you want with a thing called a Coroutine and WaitForSeconds inside of it. You can read more about them here.
-Unity - Scripting API: Coroutine
-Unity - Scripting API: WaitForSeconds

But basically what I think you want here is to make something like this.

void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.name.Equals("The object with the collision"))
     {
      StartCoroutine(WaitForAnimation())

     }

IEnumerator WaitForAnimation()
{
yield return new WaitForSeconds(5)  //you can change 5 to any # of secs
   GetComponent<Animator>().SetTrigger(MyTrigger);
}

This basically starts a coroutine when the trigger is called and simply waits a certain amount of seconds before passing along the code below it. Hope this helped!