I'm sorry but don't use that code quoted by HellThunder. Do not do this manually, esp. not with dedicated wait(1) loops per entity. This is an engine's task.

Entities not on screen in the sense of the camera's frustum are set to invisible/ CLIPPED automatically.


For distance based clipping camera.clip_far or LOD is the correct approach.
For special cases such as a building full of entities you can use region_set in A8 to hide all entities contained in that region manually.


If the entity count (and draw count) is a problem performance wise, you may want to think about combining multiple entities into one.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends