Kill: Difference between revisions
Jump to navigation
Jump to search
Code:To kill entities via code use UTIL_Remove. This will kill the entity on the subsequent tick.
To kill entities via VScript use Destroy() or Kill() to kill the entity on the subsequent tick
SirYodaJedi (talk | contribs) No edit summary |
(Both use UTIL_Remove to remove the entity. Kill just additionally clears the entity's owner and l4d2 doesn't have Destroy) |
||
Line 4: | Line 4: | ||
An entity's [[children]] can be killed in the same [[Source_Multiplayer_Networking#Basic_networking|tick]] by sending the {{code|KillHierarchy}} input instead, otherwise they will be killed on a subsequent tick. | An entity's [[children]] can be killed in the same [[Source_Multiplayer_Networking#Basic_networking|tick]] by sending the {{code|KillHierarchy}} input instead, otherwise they will be killed on a subsequent tick. | ||
{{Codenote|To kill entities via code use {{ent|UTIL_Remove}}. This will kill the entity on the subsequent tick.<br>To kill entities via [[VScript]] use | {{Codenote|To kill entities via code use {{ent|UTIL_Remove}}. This will kill the entity on the subsequent tick.<br>To kill entities via [[VScript]] use [https://github.com/ValveSoftware/source-sdk-2013/blob/a62efecf624923d3bacc67b8ee4b7f8a9855abfd/src/game/server/baseentity.h#L1270 Destroy()] or [https://github.com/ValveSoftware/source-sdk-2013/blob/a62efecf624923d3bacc67b8ee4b7f8a9855abfd/src/game/server/baseentity.cpp#L4582 Kill()] to kill the entity on the subsequent tick}} | ||
== See also == | == See also == |
Revision as of 16:42, 17 March 2025
Kill is an input that removes the named entity from play, and deletes its associated edict. An entity's children can be killed in the same tick by sending the KillHierarchy input instead, otherwise they will be killed on a subsequent tick.

To kill entities via VScript use Destroy() or Kill() to kill the entity on the subsequent tick