Scene Graph Destroy Entity
Despawn/destroy an entity to remove it from the world — clean up a collected pickup, a defeated enemy, a finished effect. The mirror of spawning.
Spawning puts a creature into your map — but a defeated enemy or a collected pickup needs to LEAVE the world too. Despawn is how you take it back out.
Think of a blueprint that stamps a creature in. Spawn places it; Despawn lifts that same one back off the map so nothing lingers.
We start with a creature_placer_device called Enemy. Enemy.Spawn() stamps it into the world. We Sleep five seconds so it can do its thing — then Enemy.Despawn() removes it cleanly.
Spawn creates, Despawn cleans up — always pair them so your world stays tidy.
Enemy : creature_placer_device = creature_placer_device{}
Enemy.Spawn()
Sleep(5.0)
Enemy.Despawn()
Build your own lesson with scene_graph_destroy_entity
Generate a personalized, compile-checked lesson grounded in this exact reference.
Build a lesson →