Can Physics.IgnoreCollision disable OnTrigger... events?

Here’s my situation: I have a trigger that acts as “dark area” so that every sprite that enters it has its color light (V value - HSV) changed to give the player the feeling of entering a shadow zone. The trigger has a generic script that I use a lot throughout the game, and it affects every sprite inside the trigger.

I use the OnTriggerStay() method because I want to smooth the sprites’ color change depending on their Xpos (darker the closer they are to the centre of the trigger, and lighter the farther they are from it). Due to perspective issues, I want the main character to not send the OnTrigger Enter, Stay and Exit events just for one specific trigger, and I can’t disable it since there is another character in it who does need to be endarked at te same time. I’ve tried using Physics.IgnoreCollision(trigger, player), but the trigger functionalities are still intact and working.

Due to in-game limitations, I can’t change the physics collision graph since that kind of trigger is a very specific one and modifying that now would break countless scenes. Is there some way I can achieve this without changing much code?

*NOTE: Althoug it is a sprite-based game, it is a full 3D environment and we are working with PhysX, not Box2D, that’s why I’m dealing with Physics instead of Physics2D.

Never mind, I already solved this problem by setting a very simple flag on the shadow script configurable from the Inspector.

Either way, is there a way to disable OnTrigger events somehow between 2 specific colliders with something as simple as Physics.IgnoreCollision()?

Can’t you just check what’s colliding and apply if the object is one but not the other?

Might need to know more about your game to advise but it’d be easier doing it that way.

If you need the object the character collides with to be instantiated lots of times there are still ways you can reference a specific instance and set a public bool to tell that instance is now this special collider and therefore acts differently for character X than it does to character Y.

Sorry if I’ve misunderstood the question.

EDIT:

And I think I did! was thinking triggers. What about collider.enabled = false;

EDIT 2:

And you could maybe do that with a trigger. Slightly larger trigger area if the trigger == character to pass collider.enabled = false; if not collider.enabled = true;

It also looks like you should be able to fix it with your method, but it needs adding each time.