'Can't assign Animation to Animator in Unity2D

First I would like to tell you, that I already did an extenstive search about this problem and have not found a solution.

I have a C# Script called Enemy_Animation, where I declared a variable from type Animator and would like to drag and drop an animation via Unity.

The problem is that I can not assign it and I get no error.

Video: https://emalm.com/?v=-kSkn

Enemy_Animation.cs:

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

public class Enemy_Animation : MonoBehaviour
{
    public Animator play_animation;

    void OnTriggerEnter2D(Collider2D other) 
    {
        if (other.gameObject.tag == "Player") 
        {
            play_animation.SetBool("playBowAnimation", true);
        }
    }
}


Solution 1:[1]

The problem is that the Animator variable is a reference to the animator component not the animation clip, what you need to do is create an animator controller, put the animation clip inside the controller, then drag and drop the controller inside the play_animation variable

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LegendarySwordsman2