OnTriggerEnter not being called, have trigger, RB, and colliders set?

Hi!

I have a GameObject that is supposed to set a boolean on its animator to true once a trigger is called. Thing is, I debugged it with print() and found that it was never called? Both the objects have 3D colliders, and one of them has a rigidbody. I have the object that needs to be collided with set to trigger. I triple-checked that my trigger Gameobject’s tag is spelled correctly as well. I am lost on what I could be missing. Please help? Thanks.

Here is the code for the trigger.

    void OnTriggerEnter(Collider other)
    {

        if(other.gameObject.tag == ("PlayerAttack"))
        {
        health = health - 40;
        print(health.ToString());
        if(health > 0)
            {
            Anim.Play("GhostLightHit");
            Anim.Play("GhostIdle");
            }
        else if(other.gameObject.tag == ("EnemyTarget"))// The script part that isn't working
            {
            print("Collided");
            Anim.SetBool(Attacking, true);
            Anim.SetBool(canMove, false);
            Audio.clip = otherClip[Random.Range(0,otherClip.Length)];
            
            }
        else
            {
            Instantiate(GhostDead, transform.position, transform.rotation);
            Destroy(gameObject);
            }
        }
    }

I didn’t exactly figure it out, but I found a workaround. I added a private boolean canMove, and made it so that it switches to false OnTriggerEnter. Everything in the section for the part that doesn’t work has been placed in an if statement to test if the new bool is true or not. If not, then the part that was ignored previously takes place.

Still curious on what I did wrong in the original code, though. There has to be a more effective way of doing things.