HLMV create hitboxes

From Valve Developer Community
Jump to navigation Jump to search

If you are starting from scratch, you can use HLMV to create a base set of hitboxes, and then modify them to fit your models needs. This page will take you step by step through the process of creating a base set, and then modifying it for your models needs. In order for this to work, you will need a model that compiles properly and has a least 1 bone that the geometry is skinned to.

Auto Generating hitboxes

The first thing we'll do is get HLMV to to create a set of hitboxes for us. When it does this it will create a hitbox for every bone that has geometry skinned to it, and will fit the hitbox around that geometry.

  1. Open HLMV and load your model. From the Render tab press CTRL+H or select the Hit Boxes checkbox to view the hitboxes
  2. Select the Bones tab. If you did not create hitboxes in your .qc/.qci file(s) then the Auto-Generate Hitboxes checkbox should be ON. If you have specified some hitboxes, turning on the auto-generation will do nothing.
  3. With the auto-generated hitboxes visible, click Generate QC button. This will copy the .qc commands needed to create the auto-generated hitboxes into your clipboard.
  4. Open your model's .qc or create a new hitbox.qci file with your favorite text editor. CTRL+V to paste the autogenerated .qc lines into the file, save it, and recompile your model. It should look something like this:

You can now leave the model as is, or use HLMV to edit the boxes depending on your needs.

Modifying your hitboxes with HLMV

Once you have a base set of hitboxes, using a combination of HLMV and good ol text editing is the fastest way to modify your hitboxes to your needs.