Actor Not Being Killed Offscreen

spaceman

  • Posts: 17
I have a problem with an actor not being killed when outside of the screen bounds. I have a single scene,  a scene behaviour that creates an actor, and pushes it+rotates it in a direction leading it off the screen. The actor has no behaviours, and its only event is a 'do every' block, it checks if it's alive, and prints to the console that the actor is still alive. There is no "make self always active" block anywhere near the actor or the behaviour that creates it, or any 'set offscreen bounds' blocks either. I know that the actor should normally be killed the moment a part of it leaves the screen, but that's certainly not the case here. Attached is the scene behaviour (create asteroids on click), and the asteroids actor event (print every 0.1 sec if it's still alive).

What can possibly cause an actor to stay alive offscreen?

rob1221

  • *
  • Posts: 9473
Quote
I know that the actor should normally be killed the moment a part of it leaves the screen
No, this is false.  It is deactivated but not killed.  An actor will only kill itself outside the screen if you use the "kill self after leaving screen" block.

spaceman

  • Posts: 17
Quote
I know that the actor should normally be killed the moment a part of it leaves the screen
No, this is false.  It is deactivated but not killed.  An actor will only kill itself outside the screen if you use the "kill self after leaving screen" block.

Thank you, that clarifies some things. I decided to make a custom Die when Offscreen behaviour for my purposes to solve my problem.

Is there any documentation on how it becomes "deactivated" and what exactly that implies?

captaincomic

  • *
  • Posts: 6108
StencylPedia says this
Quote
Off Screen Actors Become Inactive

Something you may notice is that actors that are off screen stop “simulating”, as if they "froze" in time. We do this to preserve performance.

Nevertheless, there are cases where you want an actor to be active regardless of whether it’s on or off screen.

To make an actor always active, use the following block.


(Actor > Properties > Misc)
http://www.stencyl.com/help/viewArticle/114

Basically inactive actors stop moving and their behaviors are not executed anymore.