detect trigger does not work with "teleport"?

I’m using the OnTriggerEnter to detect if an object is moving through a wall but the detecter is not the player but an empty that has the same location as the player. I’m setting the position of the empty to the position of the main player. and I think this does not trigger the trigger since its not moving trough it but teleporting on the other side. is there a way to fix this?

If you are moving an empty game object from one location directly to another location without passing through the trigger then OnTriggerEnter will not happen because the game object never enters your wall.

You should be able to fix that by having the object move from its current location to the new location in the world space. Also make sure that your ‘empty’ game object is not entirely empty you need a rigidbody to use OnTriggerEnter.

what is the difference between: “moving an empty game object from one location directly to another location” and “having the object move from its current location to the new location” also if i add rigid body does it also need a collider?