Destroy outside screen behavior

I would rather see the Destroy outside screen behavior examples! Please take me there now.

This is one of the most simple, yet useful, behaviors. Add it to an object and then, whenever an instance of this object goes out of the bounds of the game scene/screen, this instance will be destroyed.

It's a simple way of ensuring that your game is not filled with garbage objects that could slow it down.

Add behavior to object

To add a behavior to an object, first open the object properties by right-clicking on the object that is located in the Objects list. Select “Edit object” from the popup list. Then select the Behaviors tab. Click the “add behavior” button.

Destroy when outside of screen

Once you have selected the destroy behavior from the list, it is going to eliminate the object whenever it is outside the screen. This behavior has no options to change and automatically applies to all instances of the object.


See it in action! 🎮
Open these examples online.

Outside the Screen Behavior

Destroy Bullets Outside Screen/Scene

Shooting Bullets Explanation