OnTriggerExit not working?

I am using 2019.3.1f1 and I am having some strange issues. I’m trying to make a portal and I’m using triggers to do it. Here’s the script I’m using:

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

public class PortalScript : MonoBehaviour
{
    public bool portalActive;
    public PortalScript LinkedPortal;
    public Transform LinkedPoint;
    AudioSource _audio;
    public ParticleSystem TeleportEffect;

    private void Awake()
    {
        _audio = GetComponent<AudioSource>();
    }

    private void OnTriggerEnter(Collider other)
    {
        if(portalActive)
        {
            Debug.Log(other.name + " has entered bounds of " + name);

            if (other.CompareTag("Player"))
            {
                if(other.GetComponent<Player2DControl>().useWorldInteraction)
                {
                    _audio.Play();
                    LinkedPortal.portalActive = false;
                    Instantiate(TeleportEffect, other.transform);
                    other.transform.position = LinkedPoint.position;
                }
            }
        }
    }

    private void OnTriggerExit(Collider other)
    {
        Debug.Log(other.name + " has left bounds of " + name);
        if (other.CompareTag("Player"))
        {
            portalActive = true;
        }
    }
}

When the player presses the up button, useWorldInteraction is set to true. What’s strange is when the Player collider enters the trigger, it sends the debug message multiple times, like in a rapid fire sense. I’m not sure why either because the collider isn’t being activated/deactivated and there is only one collider on the player that is in the layer being detected. The OnTriggerExit NEVER activates. The player leaves the trigger upon moving out of it, but the function is never called. Is OnTriggerExit broken or what? In my experience, OnTriggerEnter/Exit only executes ONCE when an object enters or exits the Trigger, right? This seems like a bug.

From what I can see your portalActive is always true. If OnTriggerExit you want it to be true, then you need to define when it is false, otherwise it is always true. In your code you define the Linked.portalActive = false but not the current portalActive. Maybe set the portalActive to false in the beginning.

Just a thought, maybe look at how Brackeys did a portal.

It isn’t active all the time. Once the portal is used, it is set to inactive until the player leaves the trigger. The problem is that OnTriggerExit is not activating.

Try a debug.log and see what the bool is true or false and also do a debug on Ontriggerexit to see if it is actually showing the player exit.
Then post the log here, so we can see it.