How to identify which collider generated OnTriggerEnter2D
void OnTriggerEnter2D(Collider2D other) provides information about the other collider, but how do I find out which collider on this object triggered it?
I have 2 colliders on my Player game object. One is a large CircleCollider2D representing a field around the player and the other is a small CircleCollider2D representing the player's core. Both have Is Trigger set.
When the outer collider comes in contact with Terrain, it triggers a warning behaviour but when the inner collider comes in contact with Terrain, you start losing health.
In the script attached to the Player, how can I tell which collider is generating OnTriggerEnter2D?
Your answer
Follow this Question
Related Questions
Collision with trigger is not working 1 Answer
one time Trigger and I get two OnTriggerEnter2Ds and two OnTriggerExit2Ds 0 Answers
Color triggered collider? 0 Answers
Moving a child object to collide with wall. 1 Answer
How To create 2D collision detection on object which changes dimensions 1 Answer