phys_spring

From Source Entities
Jump to navigation Jump to search

Code classes:

phys_spring is a point entity present in all Source games. It acts as a spring, connecting two objects together.

Note: The entity should be placed where you want one end to be, and Spring Axis should be placed at the other. (Otherwise, odd movement may occur.)

Flags[edit | edit source]

  • 1: Force only on stretch - Spring will never try to expand itself in order to reach Spring Length.

Keyvalues[edit | edit source]

Entity 1 (attach1) <target_destination>
First entity to attach.
Entity 2 (attach2) <target_destination>
Second entity to attach. Leave blank to attach Entity 1 to the world.
Spring Axis (springaxis) <vecline>
Other end of the spring. (The first end is this entity's origin.)
Spring Length (length) <float>
How long the spring should normally be, not accounting for forces such as gravity and friction. If not specified, the length will simply be the distance from the origin to Spring Axis.
Spring Constant (constant) <float>
How much force the spring will use to shrink or grow to reach the Spring Length.
Damping Constant (damping) <float>
The spring's inverse elasticity; larger numbers will cause the spring to be less bouncy.
Relative Damping Constant (relativedamping) <float>
How much to slow the object down, in all directions, when the spring is trying to expand or contract. Does not affect rotation. Increasing this may help reduce jiggling.
Break on Length (breaklength) <float>
Doesn't exist in code.

Inputs[edit | edit source]

SetSpringConstant <float>
Sets Spring Constant.
SetSpringLength <float>
Sets Spring Length.
SetSpringDamping <float>
Sets Damping Constant.