Y
Y
Yura Milevsky2021-08-01 14:16:02
Unity
Yura Milevsky, 2021-08-01 14:16:02

How to choose the trigger to bind OnTriggerEnter to?

I have 2 collider triggers. How can I specify in void OnTriggerEnter(Collider other) which trigger this function belongs to? What and where should be done to make these 2 triggers different and specify in the function? I need NOT SEPARATE OBJECTS TO TRIGGERS, but a TRIGGER to a FUNCTION. Tobish that one function checked one trigger, another, another.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-08-01
@Hackerman1

Well, the maximum that can be done is to set up the interaction between the layers.
But in general - OnTriggerEnter reacts to all triggers. You have to manually check

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question