prop_ragdoll
- For details on creating a ragdoll, see $collisionjoints.
prop_ragdoll
is a point entity available in all Source games. It is a VPhysics ragdoll. Ragdolls are collections of physics objects constrained together to simulate a jointed object like a dead body. They are very expensive to simulate.



physics_prop_ragdoll
. In code, it is represented by class
CRagdollProp
, defined in physics_prop_ragdoll.cpp
.
See also Prop Types Overview.
Death ragdolls/ragdoll transformation
When a NPC/player dies or an entity receives the BecomeRagdoll
input, it normally creates a client-side ragdoll and copies most of its animation and visual data to it. Unlike server-side prop_ragdolls, these client-side ragdolls are handled completely on a per-client basis and are much cheaper and simpler than their server-side counterparts, at the expense of being virtually nonexistent on the server, being inconsistent across client perspectives, and only colliding with entities that have physics objects on the client (e.g. worldspawn
).
However, a NPC will become a server-side ragdoll while it's under any of the following conditions:
- The NPC is inside the volume of a trigger_serverragdoll
- The NPC is killed by a vehicle in singleplayer
- The gravity gun is supercharged
- The NPC dies on fire while in Alyx darkness mode
- The NPC is a vital ally (e.g.
npc_alyx
)
These server-side death ragdolls will collide with physics objects and beyond, like any prop_ragdoll, but they are marked as debris and do not collide with each other. They do not collide with themselves either, unlike client-side ragdolls. This is believed to be intentional behavior to reduce performance/networking costs.


Code:This can be modified at
CBaseAnimating::CopyAnimationDataFrom()
inbaseanimating.cpp
for server-side ragdolls andC_BaseAnimating::CreateRagdollCopy()
inc_baseanimating.cpp
for client-side ragdolls.
Keyvalues
- sequence
<integer>
!FGD - The ragdoll will be moved to the first frame of this animation before VPhysics takes over.
Bug: Doesn't function.
- body
<integer>
!FGD - Specifies which body group should be used.
- Override Animation
<string>
- Filled in by the engine via wc_update_entity. Do not edit by hand except to clear.
DXLevelChoice:
- Minimum DX Level
(mindxlevel)
<choices>
- The entity will not exist if the engine is running outside the given range of DirectX Versions. Replaced by SystemLevelChoice from
Left 4 Dead onwards.
Warning: If these are used, the object may break when the user switches their DirectX settings.
- Maximum DX Level
(maxdxlevel)
<choices>
SystemLevelChoice:
- Minimum CPU Level
(mincpulevel)
<choices>
(in all games since)
- A user with a CPU level lower than this will not see this object rendered in-game. CPU levels are determined by the Effect detail setting.
- Maximum CPU Level
(maxcpulevel)
<choices>
(in all games since)
-
- 0: Default
- 1: Low
- 2: Medium
- 3: High
- Minimum GPU Level
(mingpulevel)
<choices>
(in all games since)
- A user with a GPU level lower than this will not see this object rendered in-game. GPU levels are determined by the Shader detail setting.
- Maximum GPU Level
(maxgpulevel)
<choices>
(in all games since)
-
- 0: Default
- 1: Very low
- 2: Low
- 3: Medium
- 4: High
Studiomodel:
- World Model (model)
<string>
- The model this entity should appear as. 128-character limit.
- Skin (skin)
<integer>
- Some models have multiple skins. This value selects from the index, starting with 0.
Tip: Hammer's model browser automatically updates this value if you use it to view different skins.
- Model Scale (modelscale)
<float>
(in all games since)
- A multiplier for the size of the model.
Shadow:
- Disable Shadows (disableshadows)
<boolean>
- Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a
prop_static
. Does not affect shadow mapping. - Disable ShadowDepth (disableshadowdepth)
<boolean>
(in all games since)
- Used to disable rendering into shadow depth (for projected textures) for this entity.
- Projected Texture Cache (shadowdepthnocache)
<choices>
(in all games since)
- Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
- 0 : Default
- 1 : No cache - render every frame
- 2 : Cache it - render only once
- Disable flashlight (disableflashlight)
<boolean>
(in all games since)
- Used to disable projected texture lighting and shadows on this entity.
Reflection:
- Render in Fast Reflections (drawinfastreflection)
<boolean>
(in all games since)
- If enabled, this entity will render in fast water reflections (i.e. when a water material specifies
$reflectonlymarkedentities
) and in the world impostor pass.
Angles:
- Pitch Yaw Roll (Y Z X)
(angles)
<angle>
- This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
BaseFadeProp:
- Start Fade Dist (fademindist)
<float>
- Distance at which the prop starts to fade.
- End Fade Dist (fademaxdist)
<float>
- Max fade distance at which the prop is visible.
- If start fade is <0, the prop will disappear instantly when end fade is hit.
- If end fade is <0, the prop won't disappear at all. (This is the default behaviour.)
- The values will scale appropriately if the prop is in a 3D Skybox.
- Fade Scale (fadescale)
<float>
- If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in Ep1), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.
Targetname:
- Name
(targetname)
<string>
- The targetname that other entities refer to this entity by.
- Entity Scripts
(vscripts)
<scriptlist>
(in all games since)
- Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
- Script think function
(thinkfunction)
<string>
(in all games since)
- Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note: Try to avoid expensive operations in this function, as it may cause performance problems.
GMODSandbox:
- Allow Physics Gun
(gmod_allowphysgun)
<boolean>
(only in)
- If set, players cannot use Physics Gun on this entity.
- Sandbox Tool Whitelist
(gmod_allowtools)
<string>
(only in)
- If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!
Flags
- 4 : Debris - Don't collide with the player or other debris
- 8192 : Allow Dissolve
- 16384 : Motion Disabled
- 32768 : Allow stretch
- 65536 : Start asleep
Inputs
StartRagdollBoogie
- Begins ragdoll boogie effect for 5 seconds.
Bug: This input is actually supposed to use a parameter for how long the ragdoll should boogie, but it uses the wrong field type in the data description.
Code Fix: In
CRagdollProp
's data description, findDEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie )
and replaceFIELD_VOID
withFIELD_FLOAT
.EnableMotion, DisableMotion
- Enable/disable physics simulation.
FadeAndRemove
(in all games since)
- Fade out then remove (kill) self. Parameter override = duration of fade.
Ignite
!FGD- Set on fire.
SetBodyGroup
!FGD- Change the current body group.
RenderFields:
Alpha
<integer>
- Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its Render Mode (rendermode) set to a number other than
0
. Color
<color255>
- Sets an RGB color for the entity.
Studiomodel:
Skin
<integer>
- Changes the model's skin to the specified number.
SetBodyGroup
<integer>
- Set the model's body group.
AlternativeSorting
<boolean>
- Uses an alternative method for telling which objects are in front of others. Use if this object draws incorrectly when seen through transparent things.
SetModelScale
<string>
(only in)
- Sets the model scale. Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over. If there is no second value, the model will scale instantly.
Warning: Negative or extremely high values can cause crashes!
Shadow:
DisableShadow
- Turn dynamic shadows off for this entity.
EnableShadow
- Turn dynamic shadows on for this entity.
DisableReceivingFlashlight
(in all games since)
- This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight
(in all games since)
- This object may receive light or shadows from projected textures.
Reflection:
DisableDrawInFastReflection
(in all games since)
- Turns off rendering of this entity in reflections when using
$reflectonlymarkedentities
in water material. EnableDrawInFastReflection
(in all games since)
- Turn on rendering of this entity in reflections when using
$reflectonlymarkedentities
in water material.
ToggleDraw:
DisableDraw
(in all games since)
- Add the EF_NODRAW flag to this entity. Some entities manage this on their own so be aware you can override that value.
EnableDraw
(in all games since)
- Remove the EF_NODRAW flag from this entity. Some entities manage this on their own so be aware you can override that value.
Targetname:
Kill
- Removes this entity from the world.
KillHierarchy
- Removes this entity and its children from the world.
Note: Entities already remove orphaned children upon being removed, but this input removes all children on the same frame, being marginally faster than
Kill
. AddOutput
<string>
- Adds a keyvalue/output to this entity. It can be potentially very dangerous, use with care.
KV Format:<key> <value>
I/O Format:<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1
toFireUser4
- Fire the
OnUser
outputs; see User Inputs and Outputs. Use
!FGD- Same as a player invoking +use; may not do anything depending on the entity. Can also be invoked by firing an output that does not specify an input.
RunScriptFile
<script>
(in all games since)
- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode
<string>
(in all games since)
- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In
, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction
<string>
(in all games since) !FGD
- Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin
<coordinates>
(in all games since) !FGD
- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles
<angles>
(in all games since) !FGD
- Set this entity's angles.
Outputs
Targetname:
OnUser1
toOnUser4
- These outputs each fire in response to the firing of the like-numbered
FireUser1
toFireUser4
Input; see User Inputs and Outputs. OnKilled
(only in)
- This output fires when the entity is killed and removed from the game.