Actors > Properties > Kill actor

Introduction
Killing actor means removing objects from the game scene. It can be npcs, players, items or butons or even HUDs. Since all game objects are actors. 

case: kill self. 
Please do not relate this page to suicides for this is not a suicide related blog but just how Stencyl write its snippets. 

snippet 

Codes
Note: actor in code mode is Self in Design mode

preview code
recycleActor(actor);

code without import com.stencyl.behavior.Script.*
Script.recycleActor(actor); 

computational shortcut:
Engine.engine.recycleActor(actor); 

Alternatively, if you have some bugs where killing actor at some point of your project is not working, you may use :
actor.destroy(); Engine.engine.allActors.unset(a.ID); 

No comments:

Post a Comment