Destroy projectile on leaving viewport

Hi! I’m trying to make a 2D shooter platformer, so I have had to build the projectiles myself. As a result, the projectiles act infinitely, and destroy all actors in its path without the player even getting to see them. Is there a way to have the projectile destroy itself on leaving the viewport, or after a set time?