Overlap sphere ignore myself

Hi all,

I use overlap sphere to place an object.
I wish to avoid the object I am carrying as I place it.
Problem is my carried object can have multiple colliders. Essentially I want to avoid all that are part of this object on the sphere check.
Can’t use tags or names. So how can I detect if the object reported back by sphere overlap is not ‘part of’ the carried object.


check for the root and compare against the object. Something like:

if (objectInSphere.transform.root != transform)
    //do whatever 

Physics.IgnoreCollision(X.collider, Y.collider);

My solution was:

Before I do the collision check temporairly tag myself as “ignore”. Do the collision check ignoring “ignore”. Once all done set my original tag back.