Detect when center of gameobject goes through trigger?

I only want my trigger to activate when the center of the gameobject goes through the trigger.
Ive tried “if(other.transform.position = gameobject.transform.position)” but it doesn’t work. Any ideas?

It isnt optimal but you could make a little box collider on the middle. Maybe set the scale to 0.01 on all sizes.

if(other.transform.position = gameobject.transform.position)
this code must be in OnTriggerStay method not in OnTriggerEnter method

Try out the Physics2D.OverlapPoint() method

or for 3D

Hello! For anyone else having this issue, Vector3.Distance is perfect to use, at least in my situaton.