Answer the question
In order to leave comments, you need to log in
How to make a trigger between physical bodies in a unity?
It is necessary that the block writes succes to the console when touching the player. The block has a rigit body, the player has a rigitbody and a box colider. How to do it? I'm using Unity 5. Thanks in advance for your help!
Answer the question
In order to leave comments, you need to log in
Put on the player tag "Player".
Throw this code on the box
// Для 2D
void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.CompareTag("Player") )
{
Debug.Log("success");
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question