Game Object: endObject

endObject()
  • Removes the game object
Sample Code

################## end the game object
 

# import bge
import bge

# get controller
cont = bge.logic.getCurrentController()

# get object that controller is attached to
obj = cont.owner

# end the game object
obj.endObject()