Revision Difference
constraint.Slider#560640
<function name="Slider" parent="constraint" type="libraryfunc">
<description>Creates a slider constraint. A slider is like a rope, but allows the constrained object to move only in 1 direction.</description>
<realm>Server</realm>
<file line="684-L767">lua/includes/modules/constraint.lua</file>
<args>
<arg name="Ent1" type="Entity">First entity.</arg>
<arg name="Ent2" type="Entity">Second entity.</arg>
<arg name="Bone1" type="number">Physics Object number of first entity to constrain to. (0 for non-ragdolls),</arg>⤶
<arg name="Bone2" type="number">Physics Object number of second entity to constrain to. (0 for non-ragdolls).</arg>
<arg name="LPos1" type="Vector">Position relative to the the first physics object to constrain to.</arg>⤶
<arg name="LPos2" type="Vector">Position relative to the the second physics object to constrain to.</arg>
<arg name="ent1" type="Entity">First entity.</arg>
<arg name="ent2" type="Entity">Second entity.</arg>
<arg name="bone1" type="number"><page>PhysObj</page> number of first entity to constrain to. (0 for non-ragdolls).⤶
⤶
See <page>Entity:TranslateBoneToPhysBone</page>.</arg>
<arg name="bone2" type="number"><page>PhysObj</page> number of second entity to constrain to. (0 for non-ragdolls).⤶
⤶
See <page>Entity:TranslateBoneToPhysBone</page>.</arg>
<arg name="localPos1" type="Vector">Position relative to the the first physics object to constrain to.</arg>⤶
<arg name="localPos2" type="Vector">Position relative to the the second physics object to constrain to.</arg>⤶
<arg name="width" type="number">The width of the rope.</arg>
<arg name="material" type="string" default="">The material of the rope. If unset, will be solid black.</arg>
<arg name="color" type="table" default="color_white">The color of the rope. See <page>Global.Color</page>.</arg>
</args>
<rets>
<ret name="" type="Entity">The created constraint entity. (`phys_slideconstraint`) Will return `false` if the constraint could not be created.</ret>
<ret name="" type="Entity">The created rope. (`keyframe_rope`) Will return `nil` if the constraint or the rope could not be created.</ret>
<ret name="" type="Entity">The created constraint entity. ([phys_slideconstraint](https://developer.valvesoftware.com/wiki/Phys_slideconstraint)) Will return `false` if the constraint could not be created.</ret>
<ret name="" type="Entity">The created rope. ([keyframe_rope](https://developer.valvesoftware.com/wiki/Keyframe_rope)) Will return `nil` if the constraint or the rope could not be created.</ret>
</rets>
</function>