How do I kill/disable something during a Physics iteration?

Hypothetical case:

  1. A projectile that deals damage and should die the moment it hits something.
  2. Two Physics iterations happen before we get to the Game Logic part of the frame.
  3. The projectile hits something on the first iteration. Even if we call SetActive(false) or Destroy, the OnDisable and OnDestroy events won’t happen until the end of the frame.
  4. The projectile hits something during the 2nd iteration, even though it should be dead.

Of course I could flag the projectile as dead, but it’s a pain in the ass having other systems/objects/components need to take this flag into account every time they interact with the projectile.

Any clean way to do this?

you can just use normal collision detection?

void OnCollisionEnter(Collision collision) {