OnTriggerExit() called when collider gets re-parented

I have an object Hand, with a rigid body attached to it. In every Update() call, the user’s hand controller rotation and position are tracked.

In my scene, there is an object Pin, with a mesh collider attached to it. Inside OnTriggerEnter() (called inside the Hand class), Pin becomes re-parented to Hand. (Pin’s original parent is something else.)

My scene also contains other objects with colliders. However, these other objects do not get re-parented – only Pin does.

Once this re-parenting takes place, OnTriggerExit() (inside the Hand class) is called immediately. This is surprising to me – I had expected OnTriggerStay() (inside the Hand class) to be invoked instead.

Is such behaviour by design? Is there an elegant way of working around such behaviour?

Let me see if I get the situation correctly.

You have a gameobject in your scene, which has a mesh collider attached. Is the OnTriggerEnter called from that object, or from the player/hand?

It is called from the Hand class. I will update my question to make this clear.

Hmm. I have no idea what causes this issue. Though it probably won’t make a difference here, I wouldn’t use a mesh collider for these purposes. I would simply use a box collider.

I hope you find an answer. :