Ok guys, here is the situation.
This capsule is supposed to move based on “mouse drags”. The capsule is the one who has the rigidbody component.
The Parent_capsule object also has a “shield” child. This child collider must not be a trigger because it interacts with other bodies. See the example below.
Because those shields are not triggers, we must exclude any possibility of using “Queries hit triggers” on physics inspector to solve the following issue, and here it comes:
How can we prevent the Child_Shield from capturing the mouse events for onMouseClick/Drag coded inside its parent script (Parent_Capsule)?
(I could find no tunned answer with this specific case, I guess. Sorry if this seems repetitive,).
It should move when the capsule collider (from parent) detects mouse events, not the sphere collider (from child).
Important, at first, It is not the case of filtering with layerMasks as parameter inside Raycast related methods. What we really need is to block the Child_Shield collider (again, isTrigger = false) from receiving mouse events.
However, this can be reconsidered if there is any good solution based on Layermask for this case.
They also must belong to a layer other than ‘Ignore Raycast’ but also actually act like ‘Ignore Raycast’ and not call OnMouseX events.
It seems this particular layer “Ignore Raycast” doesn’t call “OnMouseEvent” on gameObjects with those mouseFunction coded. I am not 100% sure.
I would be really grateful if someone could help me with this.
