Checking when two triggers intersect

Hi,

I’m making a stealth based element to a game I’m developing. I wish for the enemy to have a sphere collider which detects when the players movementSound sphere collider connects with it, then implement some sort of seek behaviour. Currently I have solved it with the following code in the enemy ai script:

public SphereCollider myCollider;
public PlayerMove playerObject;


void Update () {
    
    if (myCollider.bounds.Intersects(playerObject.movementSoundSphere.bounds))
    {
        Debug.Log("Player Detected!!");
    }
}

}

My question is, is there any better way to go about solving this, or is this current way efficient?

Many Thanks

Your way is inefficient. Unity has a built-in function for this situation: