void OnTriggerEnter(Collider collisionCollider) { if (mGadget != null) { Gadget otherGadget = collisionCollider.gameObject.GetComponentInParent <Gadget>(); // Avoid trigger due to collision with Floating Platform if (otherGadget is Floater || otherGadget is BoxGadget) { return; } if (otherGadget != null && otherGadget.GetPhysicsMode()) { PerformGadgetAction(); } } }