phys_genericconstraint
A configurable constraint between two objects.
- FGD
@PointClassingame/core/base.fgd, basesTwoObjectPhysics, Parentname. - cs_script type:
Entity, whatFindEntitiesByClass("phys_genericconstraint")returns. - Native class:
CGenericConstraint(curated pairing).
CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2
Inputs (43)
| Name | Parameter | From | Description |
|---|---|---|---|
RunScriptFile | string | VScript | Load and execute a script file |
RunScriptCode | string | VScript | Execute a fragment of script code |
CallScriptFunction | string | VScript | Call a script function |
CallPrivateScriptFunction | string | VScript | Calls a script function from this entity's private script scope. |
CallGlobalScriptFunction | string | VScript | Calls a script function in the global script scope. |
Kill | GameEntity | Removes this entity from the world. | |
KillHierarchy | GameEntity | Removes this entity and all its children from the world. | |
KillConstrained | GameEntity | Removes this entity, all its children, and anything constrained to it, from the world. | |
AddOutput | string | GameEntity | Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. |
FireUser1 | GameEntity | Causes this entity's OnUser1 output to be fired. | |
FireUser2 | GameEntity | Causes this entity's OnUser2 output to be fired. | |
FireUser3 | GameEntity | Causes this entity's OnUser3 output to be fired. | |
FireUser4 | GameEntity | Causes this entity's OnUser4 output to be fired. | |
EnableAutoSleeping | GameEntity | Enable automatic sleeping on this entity's physics bodies. When enabled, physics bodies go to sleep when at rest. | |
DisableAutoSleeping | GameEntity | Disable automatic sleeping on this entity's physics bodies. Bodies remain awake until explicitly put to sleep. | |
Break | TwoObjectPhysics | Force the constraint to break. | |
TurnOn | TwoObjectPhysics | Enable the constraint. Do this when the objects don't exist when the constraint spawns - or when you have deactivated the constraint. Broken constraints can NOT be turned on. They have been deleted. | |
TurnOff | TwoObjectPhysics | Disable this constraint. | |
SetParent | api | Parentname | |
SetParentWithOffset | api | Parentname | |
SetParentMaintainOffset | api | Parentname | |
SetParentAttachment | string | Parentname | Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. |
SetParentAttachmentMaintainOffset | string | Parentname | Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the parent at the time it is attached. |
ClearParent | Parentname | Removes this entity from the the movement hierarchy, leaving it free to move independently. | |
FollowEntity | string | Parentname | Bone merges this entity to a parent entity. Call again passing nothing to end the bone merge. |
SetLinearMotionLockedX | boolean | ||
SetLinearMotionLockedY | boolean | ||
SetLinearMotionLockedZ | boolean | ||
SetLinearFrequencyX | float | ||
SetLinearFrequencyY | float | ||
SetLinearFrequencyZ | float | ||
SetLinearDampingRatioX | float | ||
SetLinearDampingRatioY | float | ||
SetLinearDampingRatioZ | float | ||
SetAngularMotionLockedX | boolean | ||
SetAngularMotionLockedY | boolean | ||
SetAngularMotionLockedZ | boolean | ||
SetAngularFrequencyX | float | ||
SetAngularFrequencyY | float | ||
SetAngularFrequencyZ | float | ||
SetAngularDampingRatioX | float | ||
SetAngularDampingRatioY | float | ||
SetAngularDampingRatioZ | float |
Outputs (9)
| Name | Parameter | From | Description |
|---|---|---|---|
OnUser1 | GameEntity | Fired in response to FireUser1 input. | |
OnUser2 | GameEntity | Fired in response to FireUser2 input. | |
OnUser3 | GameEntity | Fired in response to FireUser3 input. | |
OnUser4 | GameEntity | Fired in response to FireUser4 input. | |
OnKilled | GameEntity | Fired when the entity is killed and removed from the game. Parameter is the inflictor. | |
OnBreak | TwoObjectPhysics | Fired when the constraint breaks. | |
NotifyForceReachedX | The requested force has been reached on the X axis. Won't fire if force min time is zero. | ||
NotifyForceReachedY | The requested force has been reached on the Y axis. Won't fire if force min time is zero. | ||
NotifyForceReachedZ | The requested force has been reached on the Z axis. Won't fire if force min time is zero. |
Keyvalues (55)
The names Hammer saves and the KeyValue input and AddOutput take at run time. An entity reads some keys only when it spawns, so changing one later may do nothing. Integer keys such as movetype take engine numbers, not the renumbered cs_script enum values.
| Key | Type | Default | From | Description |
|---|---|---|---|---|
vscriptsEntity Scripts | scriptlist | VScript | Name(s) of script files that are executed after all entities have spawned. | |
targetnameName | target_source | Targetname | The name that other entities refer to this entity by. | |
spawnflags | flags | TwoObjectPhysics |
| |
attach1Entity 1 | target_destination | TwoObjectPhysics | ||
attach2Entity 2 | target_destination | TwoObjectPhysics | ||
attachment1Entity 1 Attachment Name | string | TwoObjectPhysics | If set, we'll attach to the body / location corresponding to this attachment. | |
attachment2Entity 2 Attachment Name | string | TwoObjectPhysics | If set, we'll attach to the body / location corresponding to this attachment. | |
forcelimitImpulse Limit to Break (kg) | float | 0 | TwoObjectPhysics | The amount of impulse an impact must apply to the constraint to break it. A way of calculating this is to set it to the mass of an object that would break this constraint if it were resting on the constrainted objects. |
torquelimitAngular Impulse Limit to Break (kg * distance) | float | 0 | TwoObjectPhysics | The amount of angular impulse required to break the constraint. A way of calculating this is to multiply any reference mass by the resting distance (from the center of mass of the object) needed to break the constraint. |
breaksoundPlay Sound on Break | sound | TwoObjectPhysics | A sound played when the constraint is broken. | |
teleportfollowdistanceFollow teleport distance | float | 0 | TwoObjectPhysics | If one object teleports more than this many units away it will cause the other constrained object to teleport to an appropriate relative position. |
treat_entity1_as_infinite_massTreat Entity 1 As Infinite Mass | bool | 0 | TwoObjectPhysics | If true, the joint will not affect the motion of Entity 1. Entity 2 will just follow Entity 1. |
parentnameParent | target_destination | Parentname | The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent. | |
parentAttachmentNameParent Bone/Attachment Name | parentAttachment | Parentname | The name of the bone or attachment to attach to on the entity's parent in the movement hierarchy. Use !bonemerge to use bone-merge style attachment. NOTE: If this is specified the Hammer transform will be disregarded, even if 'Use Local Transform' is NOT specified (in that case local transform will be identity) | |
useLocalOffsetUse Local Transform | boolean | 0 | Parentname | Whether to respect the specified local offset when doing the initial hierarchical attachment to its parent. |
local.originLocal Origin | vector | Parentname | Offset in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment. | |
local.anglesLocal Angles | angle | Parentname | Angular offset in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment. | |
local.scalesLocal Scale | vector | 1 1 1 | Parentname | Scale in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment. |
place_anchors_at_constraint_transformPlace Anchors At Constraint Transform | boolean | 1 | If true, the joint anchors on each entity will be set to match the transform of the constraint entity. If false, the anchors will be set to the specified attachment points, or the physics body origins if no attachments are specified. | |
linear_motion_xLinear Motion X | choices | JOINT_MOTION_FREE |
| |
linear_frequency_xSpring frequency (stiffness) | float | 0 | ||
linear_damping_ratio_xSpring damping ratio | float | 0 | 0 for no damping and 1 for critical damping | |
forcelimit_xImpulse Limit to Break (kg) | float | 0 | The amount of impulse an impact must apply to the constraint to break it. A way of calculating this is to set it to the mass of an object that would break this constraint if it were resting on the constrainted objects. | |
notifyforce_xNotify when X force reaches | float | 0 | ||
notifyforcemintime_xMinimum time between event firing X event (0 disables firing) | float | 0 | ||
breakaftertime_xBreak after time at threshold on X (time) | float | 0 | ||
breakaftertimethreshold_xBreak after time threshold on X (threshold) | float | 0 | ||
linear_motion_yLinear Motion Y | choices | JOINT_MOTION_FREE |
| |
linear_frequency_ySpring frequency (stiffness) | float | 0 | ||
linear_damping_ratio_ySpring damping ratio | float | 0 | 0 for no damping and 1 for critical damping | |
forcelimit_yImpulse Limit to Break (kg) | float | 0 | The amount of impulse an impact must apply to the constraint to break it. A way of calculating this is to set it to the mass of an object that would break this constraint if it were resting on the constrainted objects. | |
notifyforce_yNotify when Y force reaches | float | 0 | ||
notifyforcemintime_yMinimum time between event firing Y event (0 disables firing) | float | 0 | ||
breakaftertime_yBreak after time at threshold on Y (time) | float | 0 | ||
breakaftertimethreshold_yBreak after time threshold on Y (threshold) | float | 0 | ||
linear_motion_zLinear Motion Z | choices | JOINT_MOTION_FREE |
| |
linear_frequency_zSpring frequency (stiffness) | float | 0 | ||
linear_damping_ratio_zSpring damping ratio | float | 0 | 0 for no damping and 1 for critical damping | |
forcelimit_zImpulse Limit to Break (kg) | float | 0 | The amount of impulse an impact must apply to the constraint to break it. A way of calculating this is to set it to the mass of an object that would break this constraint if it were resting on the constrainted objects. | |
notifyforce_zNotify when Z force reaches | float | 0 | ||
notifyforcemintime_zMinimum time between event firing Z event (0 disables firing) | float | 0 | ||
breakaftertime_zBreak after time at threshold on Z (time) | float | 0 | ||
breakaftertimethreshold_zBreak after time threshold on Z (threshold) | float | 0 | ||
angular_motion_xAngular Motion X | choices | JOINT_MOTION_FREE |
| |
angular_frequency_xSpring frequency (stiffness) | float | 0 | ||
angular_damping_ratio_xSpring damping ratio | float | 0 | 0 for no damping and 1 for critical damping | |
torquelimit_xAngular Impulse Limit to Break (kg * distance) | float | 0 | The amount of angular impulse required to break the constraint. A way of calculating this is to multiply any reference mass by the resting distance (from the center of mass of the object) needed to break the constraint. | |
angular_motion_yAngular Motion Y | choices | JOINT_MOTION_FREE |
| |
angular_frequency_ySpring frequency (stiffness) | float | 0 | ||
angular_damping_ratio_ySpring damping ratio | float | 0 | 0 for no damping and 1 for critical damping | |
torquelimit_yAngular Impulse Limit to Break (kg * distance) | float | 0 | The amount of angular impulse required to break the constraint. A way of calculating this is to multiply any reference mass by the resting distance (from the center of mass of the object) needed to break the constraint. | |
angular_motion_zAngular Motion Z | choices | JOINT_MOTION_FREE |
| |
angular_frequency_zSpring frequency (stiffness) | float | 0 | ||
angular_damping_ratio_zSpring damping ratio | float | 0 | 0 for no damping and 1 for critical damping | |
torquelimit_zAngular Impulse Limit to Break (kg * distance) | float | 0 | The amount of angular impulse required to break the constraint. A way of calculating this is to multiply any reference mass by the resting distance (from the center of mass of the object) needed to break the constraint. |