DestroyThing


Calls a thing's removed message and removes it from the game. Syntax:

DestroyThing(thing);

Remember that removing the thing that the camera is looking at will crash the game. The camera can be switched to something else in the removed message without crashing.

Be careful of the variable that you give to DestroyThing(). If the variable has not been given a value or has a value of zero, it will destroy the thing with a number of 0. This thing is usually the player, and if the camera is looking at the player, this will crash the game.

In some cases, checking the signature of a thing before destroying it provides an adequate safeguard against destroying the wrong thing.