S&box Wiki

Revision Difference

phys_lengthconstraint#547242

<title>phys_lengthconstraint</title> # phys_lengthconstraint A constraint that preserves the distance between two entities. If the 'Keep Rigid' flag is set, think of it as a rod. If not, think of it as a virtual rope. ### Keyvalues ⤶ + Name (`targetname`) ⤶ > The name that other entities refer to this entity by. ⤶ + Tags (`tags`) > A list of general purpose tags for this entity, for interactions with other entities such as triggers. ⤶ + Additional Length (`addlength`) > Add (or subtract) this amount to the rest length of the rope. ⤶ **Name (`targetname`)**⤶ >* The name that other entities refer to this entity by. ⤶ **Tags (`tags`)** >* A list of general purpose tags for this entity, for interactions with other entities such as triggers. ⤶ **Additional Length (`addlength`)**⤶ ⤶ >* Add (or subtract) this amount to the rest length of the rope.⤶ + Minimum Length (`minlength`) > If the constraint is not rigid, this is the minimum length it can be. **Minimum Length (`minlength`)**⤶ >* If the constraint is not rigid, this is the minimum length it can be.⤶ + Attached object 2 point (`attachpoint`) > The position the rope attaches to object 2⤶ **Attached object 2 point (`attachpoint`)**⤶ >* The position the rope attaches to object 2⤶ + Keep Rigid (`KeepRigid`) > Keep the constraint rigid, as if it were a stick. **Keep Rigid (`KeepRigid`)**⤶ >* Keep the constraint rigid, as if it were a stick.⤶ + Particle Effect (`ParticleEffect`) > If give, will spawn given particle as the rope. Particle's Control Point 1 will be set to the target entity, and will be removed if the constraint breaks. ⤶ + Entity 1 (`attach1`) > The source entity to constrain from. Leave empty to constrain from the world entity. ⤶ + Entity 2 (`attach2`) > The entity we constrain to. ⤶ + Enable Collision (`enablecollision`) > Constraints disable collision between the attached entities. In some rare cases we want to enable this collision. ⤶ + Impulse Limit to Break (kg) (`forcelimit`) > 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. ⤶ **Particle Effect (`ParticleEffect`)**⤶ >* If give, will spawn given particle as the rope. Particle's Control Point 1 will be set to the target entity, and will be removed if the constraint breaks. ⤶ **Entity 1 (`attach1`)** >* The source entity to constrain from. Leave empty to constrain from the world entity. ⤶ **Entity 2 (`attach2`)** >* The entity we constrain to. ⤶ **Enable Collision (`enablecollision`)**⤶ ⤶ >* Constraints disable collision between the attached entities. In some rare cases we want to enable this collision. ⤶ ⤶ **Impulse Limit to Break (kg) (`forcelimit`)**⤶ ⤶ >* 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. ⤶ + Angular Impulse Limit to Break (kg* distance) (`torquelimit`) > 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. ⤶ + Play Sound on Break (`breaksound`) > A sound played when the constraint is broken.⤶ **Angular Impulse Limit to Break (kg* distance) (`torquelimit`)**⤶ >* 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. ⤶ **Play Sound on Break (`breaksound`)**⤶ ⤶ >* A sound played when the constraint is broken.⤶