Hello all!
I’m having a bit of an issue with two objects hitting each other. I am probably not doing this the correct or the most efficient way, but I have two objects. One (which is object pooled) moves along the X axis, deleted when it gets to a certain point, and re-spawned. Kind of like a conveyor belt. This object only has a box collider with isTrigger checked. The other object is below it and has both a box collider and a rigidbody. This moves on the y axis.
When I test it out, it passes through, which is what I want, but it doesn’t call the onCollisionEnter2d function.
Is there a way for these two objects to phase through each other, and still alert the functions?
void OnCollisionEnter2D (Collision2D other) {
if (this.gameObject.tag == "conveyorItem")
{
Debug.Log("CorrectTag");
if (other.gameObject.tag == "shootItem")
{
Debug.Log("Hit!");
}
}
}