Two colliders on GameObject with only one acting as trigger

I’m making a 2D Android game and I need two colliders on each object.

One is a box collider that’s a little bigger than the sprite to act as a hit box and detect whether the user has touched the object. It needs to be a little bigger than the sprite so that the touch will still be recognised if the user touches a little bit outside the object.

The other is a polygon collider that matches the shape of the sprite - I want this to act as a trigger to use with the OnTriggerEnter method.

The problem is that both colliders are acting as a trigger and activating the OnTriggerEnter method, which means the method is running when another object comes close to the object since the Box Collider is bigger than the sprite.

I’ve unticked the ‘Is Trigger’ box on the Box Collider but it hasn’t helped.

Is there a way to have two colliders on on object but only have one act as a trigger? Does anyone have any other suggestions as to how to solve this problem?

Put the hitbox child object on a different layer than the ball object. Make sure in the Edit|Preferences|Physics2D that the collision matrix has the hitbox child object’s layer NOT colliding with the layer of the objects you want the polygon collider to trigger.

Sorry but for me it’s impossible. but there is a simple way to get around your problem.

Put your polygon collider on your sprite and put your the collider on a child of your sprite.
So you need a second script on your child. But it’s easy if you use a reference of that script in your first script.