When I was a kid, Space Invaders gave me nightmares (literally). Yeah, I am that old. So I decided to make my Laser Defender a game with birds and balls instead of ships and lasers. All was well up until I decided that I had learned enough to make the ball hit the bird and have the bird bounce away from the ball. This doesn’t work with OnTriggerEnter2D, because apparently if “is Trigger” is True, then the bird will not bounce away from the ball. So I tried switching OnTriggerEnter2D to OnCollisionEnter2D. Now the bird will bounce away, but the subroutine is never called and the bird is never destroyed. Any ideas as to what I could have done wrong?
Here is part of the script:
private void OncollisionEnter2D(Collision2D other)
{
Debug.Log("Collision Happened!");
DamageDealer damageDealer = other.gameObject.GetComponent<DamageDealer>();
if(!damageDealer) { return; }
ProcessHit(damageDealer);
}
Collison Happened! is never reported in the console.
Thanks!