Two colliders that trigger different things in the same object-hierarchy
I am trying to create something that is able to trigger two different things depending on which collider/trigger the player enters. Like the illustration shows, I want to be able to say that if the player enters an outside collider (which is a circle collider), something happens, but when the player enters the box collider inside the circle collider, something else happens. The illustration show what I am thinking of:
What I want is for these colliders to be part of the same object-hierarchy. The box collider can be a child of the circle collider or vice verca.
Is there any way I can check something like: If the player enters a collider, check if the collider has the tag "circleCollider", or whatever, and if it does, make something happen, but if the collider has this other tag which is "Boxcollider", do something else.
So basically one OnTriggerEnter2D event for the parent gameobject that checks what tag the collider which the player enters has, and acts accordingly?
Your answer
Follow this Question
Related Questions
My gameobject stops moving after entering the trigger?? 2 Answers
Roll a ball and quiz (Pause scene, load scene and resume) 0 Answers
how do I trigger a different game object outside a script? 0 Answers
[FIXED] Help with Using Trigger to Move Scenes 1 Answer
How to change value of another gameobject through script 2 Answers