- Home /
Get local collider triggered from OnTriggerEnter()
Say you have a game object with multiple box collider triggers. Say another game object enters one of these triggers, setting off on trigger enter in a script attached to the object it triggered. Is it possible to get from on trigger enter the specific collider that was triggered, should more than one be attached to the same game object?
Comment
Answer by brendanperry05 · Aug 09, 2018 at 04:15 AM
Here is what I would suggest as the simplest solution:
Create an empty gameobject for every collider you're using and parent them to your gameobject. Use your hit detection script on each empty gameobject individually to find out which one is hit.