Hitbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added section on creating hitboxes)
m (added language bar.)
Line 1: Line 1:
{{lang|Hitbox}}
[[File:Hitbox.jpg|right|250px]]
[[File:Hitbox.jpg|right|250px]]


Line 7: Line 8:
== Creating Hitboxes ==
== Creating Hitboxes ==


There are a couple ways of creating hitboxes.  You can create them manually from scratch through the .qc commands, or allow HLMV to auto-generate a set for you and then modify them from there. If your .qc file is getting cluttered, the best way to keep your .qc files organized is to create a "hitbox.qci" file which contains your hitbox data and link to it from your models primary .qc file with <code>$include hitbox.qci</code>.
There are a couple ways of creating hitboxes.  You can create them manually from scratch through the <code>.qc</code> commands or allow [[Model Viewer|HLMV]] to auto-generate a set for you and then modify them from there. If your QC file is getting cluttered, the best way to keep your QC files organized is to create a <code>hitbox.qci</code> file which contains your hitbox data. You can link to it from your model's primary QC file with <code>$include hitbox.qci</code>.


Click through to learn to [[HLMV create hitboxes|Create and Modify hitboxes with HLMV]].
Click through to learn to [[HLMV create hitboxes|Create and Modify hitboxes with HLMV]].


== Console commands ==
== Console Commands ==


{{IO|sv_showhitboxes|param=int|Displays the server-side hitboxes of the specified player index, bypassing any <code>net_fakelag</code>. Generates a lot of traffic, so should only be used on local servers.  
{{IO|sv_showhitboxes|param=int|Displays the server-side hitboxes of the specified player index, bypassing any <code>net_fakelag</code>. Generates a lot of traffic, so should only be used on local servers.  
: This has been removed from Valve's games due to the confusion it causes with regard to [[lag compensation]], but is still in the mod SDK.}}
: This has been removed from Valve's games due to the confusion it causes with regard to lag compensation, but is still in the mod SDK.}}


== See also ==
== See Also ==


* <code>[[$hbox]]</code>
* {{ent|$hbox}}
* <code>[[$hboxset]]</code>
* {{ent|$hboxset}}
* [[Lag compensation]]
* [[Lag Compensation]]


[[Category:Modeling]]
[[Category:Modeling]]
[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 08:03, 4 May 2022

English (en)Português do Brasil (pt-br)中文 (zh)Translate (Translate)
Hitbox.jpg

A hitbox is an invisible box (or more often a series of boxes) which define the rough shape of a model for purposes of damage-based collision detection. A typical model within a game is much too high-poly to perform real-time hit calculations on, so hitboxes are used instead.

A hitbox is different from a bounding box in that it is more complex and closer to the model's visible shape. The bounding box is used for movement-based collision detection, and is usually literally a single box.

Creating Hitboxes

There are a couple ways of creating hitboxes. You can create them manually from scratch through the .qc commands or allow HLMV to auto-generate a set for you and then modify them from there. If your QC file is getting cluttered, the best way to keep your QC files organized is to create a hitbox.qci file which contains your hitbox data. You can link to it from your model's primary QC file with $include hitbox.qci.

Click through to learn to Create and Modify hitboxes with HLMV.

Console Commands

sv_showhitboxes <integerRedirectInput/integer>
Displays the server-side hitboxes of the specified player index, bypassing any net_fakelag. Generates a lot of traffic, so should only be used on local servers.
This has been removed from Valve's games due to the confusion it causes with regard to lag compensation, but is still in the mod SDK.

See Also