So, I’m having trouble with the wonderful world of collision events. My problem is that the program should print “here” (the test case) when a bullet collides with either the player or the ground, but instead it passes through. The method is as follows:
void onCollisionEnter2D(Collider2D collider) {
Debug.Log("here");
if (collider.tag.Equals("Environment")) {
Destroy(gameObject);
} if (collider.tag.Equals("Player")) {
Destroy(gameObject);
}
}
The “Environment” tag is the ground. The player, ground, and bullet each have rigidbody2D (that are not kinematic) and boxcollider2D (that are triggers). Any help?