Skip to content

phys_genericconstraint

Entity I/O / phys_genericconstraint

A configurable constraint between two objects.

  • FGD @PointClass in game/core/base.fgd, bases TwoObjectPhysics, Parentname.
  • cs_script type: Entity, what FindEntitiesByClass("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)

NameParameterFromDescription
RunScriptFilestringVScriptLoad and execute a script file
RunScriptCodestringVScriptExecute a fragment of script code
CallScriptFunctionstringVScriptCall a script function
CallPrivateScriptFunctionstringVScriptCalls a script function from this entity's private script scope.
CallGlobalScriptFunctionstringVScriptCalls a script function in the global script scope.
KillGameEntityRemoves this entity from the world.
KillHierarchyGameEntityRemoves this entity and all its children from the world.
KillConstrainedGameEntityRemoves this entity, all its children, and anything constrained to it, from the world.
AddOutputstringGameEntityAdds 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.
FireUser1GameEntityCauses this entity's OnUser1 output to be fired.
FireUser2GameEntityCauses this entity's OnUser2 output to be fired.
FireUser3GameEntityCauses this entity's OnUser3 output to be fired.
FireUser4GameEntityCauses this entity's OnUser4 output to be fired.
EnableAutoSleepingGameEntityEnable automatic sleeping on this entity's physics bodies. When enabled, physics bodies go to sleep when at rest.
DisableAutoSleepingGameEntityDisable automatic sleeping on this entity's physics bodies. Bodies remain awake until explicitly put to sleep.
BreakTwoObjectPhysicsForce the constraint to break.
TurnOnTwoObjectPhysicsEnable 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.
TurnOffTwoObjectPhysicsDisable this constraint.
SetParentapiParentname
SetParentWithOffsetapiParentname
SetParentMaintainOffsetapiParentname
SetParentAttachmentstringParentnameChange 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.
SetParentAttachmentMaintainOffsetstringParentnameChange 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.
ClearParentParentnameRemoves this entity from the the movement hierarchy, leaving it free to move independently.
FollowEntitystringParentnameBone merges this entity to a parent entity. Call again passing nothing to end the bone merge.
SetLinearMotionLockedXboolean
SetLinearMotionLockedYboolean
SetLinearMotionLockedZboolean
SetLinearFrequencyXfloat
SetLinearFrequencyYfloat
SetLinearFrequencyZfloat
SetLinearDampingRatioXfloat
SetLinearDampingRatioYfloat
SetLinearDampingRatioZfloat
SetAngularMotionLockedXboolean
SetAngularMotionLockedYboolean
SetAngularMotionLockedZboolean
SetAngularFrequencyXfloat
SetAngularFrequencyYfloat
SetAngularFrequencyZfloat
SetAngularDampingRatioXfloat
SetAngularDampingRatioYfloat
SetAngularDampingRatioZfloat

Outputs (9)

NameParameterFromDescription
OnUser1GameEntityFired in response to FireUser1 input.
OnUser2GameEntityFired in response to FireUser2 input.
OnUser3GameEntityFired in response to FireUser3 input.
OnUser4GameEntityFired in response to FireUser4 input.
OnKilledGameEntityFired when the entity is killed and removed from the game. Parameter is the inflictor.
OnBreakTwoObjectPhysicsFired when the constraint breaks.
NotifyForceReachedXThe requested force has been reached on the X axis. Won't fire if force min time is zero.
NotifyForceReachedYThe requested force has been reached on the Y axis. Won't fire if force min time is zero.
NotifyForceReachedZThe 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.

KeyTypeDefaultFromDescription
vscripts
Entity Scripts
scriptlistVScriptName(s) of script files that are executed after all entities have spawned.
targetname
Name
target_sourceTargetnameThe name that other entities refer to this entity by.
spawnflagsflagsTwoObjectPhysics
  • 1 No Collision until break
  • 4 Start inactive
  • 16 Do not connect entities until turned on
attach1
Entity 1
target_destinationTwoObjectPhysics
attach2
Entity 2
target_destinationTwoObjectPhysics
attachment1
Entity 1 Attachment Name
stringTwoObjectPhysicsIf set, we'll attach to the body / location corresponding to this attachment.
attachment2
Entity 2 Attachment Name
stringTwoObjectPhysicsIf set, we'll attach to the body / location corresponding to this attachment.
forcelimit
Impulse Limit to Break (kg)
float0TwoObjectPhysicsThe 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.
torquelimit
Angular Impulse Limit to Break (kg * distance)
float0TwoObjectPhysicsThe 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.
breaksound
Play Sound on Break
soundTwoObjectPhysicsA sound played when the constraint is broken.
teleportfollowdistance
Follow teleport distance
float0TwoObjectPhysicsIf 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_mass
Treat Entity 1 As Infinite Mass
bool0TwoObjectPhysicsIf true, the joint will not affect the motion of Entity 1. Entity 2 will just follow Entity 1.
parentname
Parent
target_destinationParentnameThe name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
parentAttachmentName
Parent Bone/Attachment Name
parentAttachmentParentnameThe 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)
useLocalOffset
Use Local Transform
boolean0ParentnameWhether to respect the specified local offset when doing the initial hierarchical attachment to its parent.
local.origin
Local Origin
vectorParentnameOffset 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.angles
Local Angles
angleParentnameAngular 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.scales
Local Scale
vector1 1 1ParentnameScale 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_transform
Place Anchors At Constraint Transform
boolean1If 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_x
Linear Motion X
choicesJOINT_MOTION_FREE
  • JOINT_MOTION_FREE Free motion
  • JOINT_MOTION_LOCKED Locked motion
linear_frequency_x
Spring frequency (stiffness)
float0
linear_damping_ratio_x
Spring damping ratio
float00 for no damping and 1 for critical damping
forcelimit_x
Impulse Limit to Break (kg)
float0The 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_x
Notify when X force reaches
float0
notifyforcemintime_x
Minimum time between event firing X event (0 disables firing)
float0
breakaftertime_x
Break after time at threshold on X (time)
float0
breakaftertimethreshold_x
Break after time threshold on X (threshold)
float0
linear_motion_y
Linear Motion Y
choicesJOINT_MOTION_FREE
  • JOINT_MOTION_FREE Free motion
  • JOINT_MOTION_LOCKED Locked motion
linear_frequency_y
Spring frequency (stiffness)
float0
linear_damping_ratio_y
Spring damping ratio
float00 for no damping and 1 for critical damping
forcelimit_y
Impulse Limit to Break (kg)
float0The 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_y
Notify when Y force reaches
float0
notifyforcemintime_y
Minimum time between event firing Y event (0 disables firing)
float0
breakaftertime_y
Break after time at threshold on Y (time)
float0
breakaftertimethreshold_y
Break after time threshold on Y (threshold)
float0
linear_motion_z
Linear Motion Z
choicesJOINT_MOTION_FREE
  • JOINT_MOTION_FREE Free motion
  • JOINT_MOTION_LOCKED Locked motion
linear_frequency_z
Spring frequency (stiffness)
float0
linear_damping_ratio_z
Spring damping ratio
float00 for no damping and 1 for critical damping
forcelimit_z
Impulse Limit to Break (kg)
float0The 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_z
Notify when Z force reaches
float0
notifyforcemintime_z
Minimum time between event firing Z event (0 disables firing)
float0
breakaftertime_z
Break after time at threshold on Z (time)
float0
breakaftertimethreshold_z
Break after time threshold on Z (threshold)
float0
angular_motion_x
Angular Motion X
choicesJOINT_MOTION_FREE
  • JOINT_MOTION_FREE Free motion
  • JOINT_MOTION_LOCKED Locked motion
angular_frequency_x
Spring frequency (stiffness)
float0
angular_damping_ratio_x
Spring damping ratio
float00 for no damping and 1 for critical damping
torquelimit_x
Angular Impulse Limit to Break (kg * distance)
float0The 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_y
Angular Motion Y
choicesJOINT_MOTION_FREE
  • JOINT_MOTION_FREE Free motion
  • JOINT_MOTION_LOCKED Locked motion
angular_frequency_y
Spring frequency (stiffness)
float0
angular_damping_ratio_y
Spring damping ratio
float00 for no damping and 1 for critical damping
torquelimit_y
Angular Impulse Limit to Break (kg * distance)
float0The 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_z
Angular Motion Z
choicesJOINT_MOTION_FREE
  • JOINT_MOTION_FREE Free motion
  • JOINT_MOTION_LOCKED Locked motion
angular_frequency_z
Spring frequency (stiffness)
float0
angular_damping_ratio_z
Spring damping ratio
float00 for no damping and 1 for critical damping
torquelimit_z
Angular Impulse Limit to Break (kg * distance)
float0The 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.