Answer the question
In order to leave comments, you need to log in
How to use OnTriggerEnter on different objects?
I have two game objects that are responsible for different mechanics, however, the player must interact with both using the OnTriggerEnter method. The point is that I don't know how to call the method and operations in it for each object separately. That is, so that when colliding with one, for example, the character increases, and when colliding with another, it decreases (this is an example, not the essence of game mechanics).
Answer the question
In order to leave comments, you need to log in
Look, you need to hang a Rigidbody on the player (it seems to be written like that) and write the OnTriggerEnter(Colader other) function in the code and then write the necessary actions, for example, if you encounter an object with the Player tag, then write if (other.tag == "Player") and then write what you need
(if you could make mistakes when typing, sorry)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question