Question by
Mouroz · Dec 24, 2018 at 10:37 PM ·
c#collisionontriggerentertag
confusion on OnTriggerEnter(Collider collision)
I alredy looked on every corner of the unity and i couldnt find whats happening to my code here
void OnTriggerEnter(Collider collision)
{
if (collision.gameObject.tag == "Wall")
{
Debug.Log("Collided");
Destroy(gameObject);
}
else
{
Debug.Log("No");
}
}
im currently looking to find collision with the walls of my game... i assure you all walls have the tag "Wall" but still not a single image is sent to the debug.log... collision with the floor... reaching a wall... nothing not a simple mensage... am i using this command wrong?
Comment
Does the player or the wall have a trigger collider? Does the wall or player have a rigidbody?