I want the monsters in my game to be deleted when there offscreen

please help

I’d say give the monsters a pretty big proximity, use a nor logic gate x > a and y > b and out being destroy.
not sure how to make them come back when they are on screen though. been trying to do that for a while.

yeah but proximitys cause lag and im trying to improve performance @F3Art

Try using extractors, if the camera follows the player then you just need to know the player’s position.

Like making your own proximity, use the players position and say to delete if the boss is X +400 pixels from the players position. Do this with x+400, x-400, y+400, y-400 and make your own proximity.

(Note: 400 is just an example number, use the size of the game x32)

@“JR 01” approach works.

I could also suggest another option.
If your camera has limited boundaries, you can create blocks offscreen called “delete”.
Once the enemies collide with that, they would delete themselves.

@“JR 01” could I get a screenshot

Something like this:

You could make pass in all filters to a Destroy block.
You could also use mailboxes or Global numbers instead to keep track of the players X and Y.

Yeah that should work - If you are concerned that It will only work on one level have different extractors (extractors require objects) for different levels depending on the object of your player ( eg: extractors for type A object 1 and extractors for type A object 2).

If your concerned about lag and spawning issues you could try making it trigger instead of always every 90 secs so stuff could spawn but would destroy if not close

That’s also why I recommended the Mailbox or Global variables just in case you wanted different levels.
You wouldn’t need an extractor for every level if you used one of these.

You could use a switch that turns itself off to only spawn once if you’re having a spawning issue.