$collisiontext
Jump to navigation
Jump to search
$collisiontext
is a QC command available in all Source games. It defines custom gibs for a breakable model. Generic gibs are instead defined by $keyvalues > prop_data > breakable_model.
Tip:Use $autocenter when compiling custom gibs to fix potential lighting oddities such as the gib randomly turning pitch black while rotating/moving around.
Tip:Make sure your parent model and gib have the same amount of skins since gibs inherit it. So as long as the parent model and the gib model have the same amount of skins defined, the gibs will spawn using the same skin.
Examples
$collisiontext { break { model mycustomgib1 health 0 } break { ragdoll mycustomgib2 health 25 fadetime 15 debris 1 burst 300 } break { model mycustomgib3 health 10 fadetime 30 fademindist 20 fademaxdist 30 } break { model mycustomgib4 health 10 fadetime 20 offset -2 3.68 12.4 } }
$collisiontext { break { "model" "mycustomgib1" "health" "0" } break { "ragdoll" "mycustomgib2" "health" "25" "fadetime" "15" "debris" "1" "burst" "300" } break { "model" "mycustomgib3" "health" "10" "fadetime" "30" "fademindist" "20" "fademaxdist" "30" } break { "model" "mycustomgib4" "health" "10" "fadetime" "20" "offset" "-2 3.68 12.4" } }
Options
model <path\name>
- The (compiled) model path to spawn as a gib. Make sure the model used as a gib is properly setup to work as a physics prop.
ragdoll <path\name>
- The (compiled) model path to spawn as a ragdoll.
offset <Vector>
- Offsets the current gib. Values are in units.
health <float>
- Overrides the model's own health value "This sometimes has to be placed in the $keyvalues line."
fadetime <float|seconds>
- Time before gibs start to fade away. They are removed once the fade is complete. Setting this will also set the gib to not collide with dynamic objects (however it can be overriden by
debris
option). fademindist <float|units>
- Distance from the camera at which to start rendering the gib.
fademaxdist <float|units>
- Distance from the camera at which to stop rendering the gib.
debris <bool>
- Prevents the gib model from colliding with dynamic objects when made true. It is strongly recommended to be enabled for any small gibs.
burst <float>
- Adds force, in units per second, to the gib, pushing it outward when the parent model breaks. This is useful if you want to make gibs go flying further away from the origin. Not defining this can lead into gibs simply falling flat to the ground. If
$autocenter
wasn't used, it will apply the force from the center of the gib piece instead of the parent model's origin. placementbone <bone>
- If set to a bone name, it will spawn the gib at the bone's origin.
placementattachment <attachment>
- If set to an attachment name, it will spawn the gib at the attachment's position.
motiondisabled <bool>
- Disables all movement, motion, of the gib if enabled.
multiplayer_break <string>
- If set to
server
, the gib will not be spawned by the client. If set toclient
, the gib will not be spawned by the server. By default, both paths are allowed. velocity <Vector>
- Applies velocity to the gib. The default value is
0 0 0
(no velocity).