I have two game objects:
- A player, with a normal collider (small, and used to detect when the object is ‘hit’), and with a trigger, which is off at all times, except when the player ‘attacks’, at which point it is briefly switched on.
- A bat with a simple trigger, to detect when it is near enemies and walls.
The issue is that when the player ‘attacks’, it triggers the events found in the bat’s OnTriggerEnter event. I have confirmed that the bat is not hitting the main, normal collider, but is instead interacting with the trigger collider of the player. Is there a way to stop this, such that the bat’s trigger collider will ignore all other trigger colliders?
EDIT:
I seem to have stumbled upon part of the answer. It turns out that upon a ‘OnTriggerEnter’ event, it calls the same event on the other object involved. I solve this issue by having the player check whether the ‘attack’ trigger is enabled.