Killtarget: Difference between revisions
Jump to navigation
Jump to search
Code:To kill entities via code:
mNo edit summary |
SirYodaJedi (talk | contribs) (Killing via code) |
||
Line 3: | Line 3: | ||
In {{src|2}}, entities are killtargeted by sending them the {{code|Kill}} [[I/O|input]]. 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. | In {{src|2}}, entities are killtargeted by sending them the {{code|Kill}} [[I/O|input]]. 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. | ||
{{modernCodenote|To kill entities via code: | |||
* In {{goldsrc|2}}, use {{ent|REMOVE_ENTITY}}. | |||
* In {{src|2}}, use {{ent|UTIL_Remove}}. | |||
}} | |||
[[Category:Glossary]] | [[Category:Glossary]] | ||
[[Category:GoldSrc Glossary]] | [[Category:GoldSrc Glossary]] |
Revision as of 09:58, 29 June 2024
killtarget is a KV in many id Tech 2 and
GoldSrc entities. It removes the named entity from play, and deletes its associated edict. This is known as "killtargeting".
In Source, entities are killtargeted by sending them the Kill input. 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.

- In
GoldSrc, use REMOVE_ENTITY.
- In
Source, use UTIL_Remove.