2D collision problem

I'm new-ish to Unity and trying to make a space invaders clone. Unfortunately my projectile isn't calling the trigger function when it hits enemy ships.
Here is the Rigidbody2D and BoxCollider2D on the enemy ships:
9854961--1419120--upload_2024-5-25_13-21-29.png

Here is the same info on the projectile:
9854961--1419123--upload_2024-5-25_13-22-44.png

If I change the projectile to not be a trigger then it hits and pushes on the enemy ships, but if I leave the BoxCollider2D IsTrigger checkbox checked I never get the OnTrigger callback. What am I doing wrong?

martiank9

[quote=“martiank91”, post:1, topic: 948437]
I never get the OnTrigger callback. What am I doing wrong?
[/quote]

No idea… can’t see the code. Any misspelling at all will make Unity not call it.

Read the docs CAREFULLY: there are several VERY specific requirements or it simply will not work.

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

I figured it out. The OnTriggerEnter2D() function was on the player ship, not the projectile. Once I moved that to the projectile everything worked.