This article's documentation is for anything that uses the Source engine. Click here for more information.

Kill: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TabsBar}}
{{TabsBar}}
{{stub}}
{{stub}}
{{code|Kill}} is an input that removes the named entity from play, and deletes its associated [[edict]].  
{{for|the identically-named console command|[[kill (console command)]]}}
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.
{{This is a|input|engine=Source|name=Kill}} It removes the named entity from play, and deletes its associated [[edict]].  
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 {{ent|Destroy()}} to kill the entity on the subsequent tick, or {{ent|Kill()}} to kill it immediately (not recommended).}}
{{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 ==

Latest revision as of 08:11, 22 April 2025

Source Engine ( input | console command )
edit

Stub

This article or section is a stub. You can help by expanding it.

For the identically-named console command, see kill (console command).

Kill is an input available in all Source Source games. It 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.

Cpp.pngCode: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

See also