Garry's Mod Wiki

Revision Difference

constraint.Pulley#560655

<function name="Pulley" parent="constraint" type="libraryfunc"> <description>Creates a pulley constraint. It consists of 3 rope segments, 2 of which have variable length, visually connected by a 3rd. Reducing length of one end will increase the length of the other end. You can visualize the pulley like so ``` WPos2 --- WPos3 | | | | Ent1 Ent4 ``` </description> <realm>Server</realm> <file line="1137-L1207">lua/includes/modules/constraint.lua</file> <args> <arg name="Ent1" type="Entity">First entity to constrain.</arg> <arg name="Ent4" type="Entity">The other entity to attach to.</arg> <arg name="Bone1" type="number">Physics Object number of first entity to constrain to. (0 for non-ragdolls).</arg>⤶ <arg name="Bone4" 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="LPos4" type="Vector">Position relative to the the second physics object to constrain to.</arg> <arg name="WPos2" type="Vector">World position constrain the first entity to. This point will be static.</arg> <arg name="WPos3" type="Vector">World position constrain the second entity to. This point will be static.</arg> <arg name="forcelimit" type="number">Amount of force until it breaks (0 = unbreakable)</arg> <arg name="ent1" type="Entity">First entity to constrain.</arg> <arg name="ent4" type="Entity">The other entity to attach to.</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="bone4" 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="localPos4" type="Vector">Position relative to the the second physics object to constrain to.</arg> <arg name="worldPos2" type="Vector">World position constrain the first entity to. This point will be static.</arg> <arg name="worldPos3" type="Vector">World position constrain the second entity to. This point will be static.</arg>⤶ <arg name="forceLimit" type="number">Amount of force until it breaks (0 = unbreakable)</arg>⤶ <arg name="rigid" type="boolean" default="false">Whether the constraint is rigid, i.e. cannot bend.</arg> <arg name="width" type="number">Width of the rope. If below or at `0`, visual rope segments will not be created.</arg> <arg name="material" type="string" default="">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. ([phys_pulleyconstraint](https://developer.valvesoftware.com/wiki/Phys_pulleyconstraint)) Will return `false` if the constraint could not be created.</ret> <ret name="" type="Entity">The first rope segment. ([keyframe_rope](https://developer.valvesoftware.com/wiki/Keyframe_rope)) Will return `nil` if the constraint or this rope segment could not be created.</ret> <ret name="" type="Entity">The second rope segment. ([keyframe_rope](https://developer.valvesoftware.com/wiki/Keyframe_rope)) Will return `nil` if the constraint or this rope segment could not be created.</ret> <ret name="" type="Entity">The third rope segment. ([keyframe_rope](https://developer.valvesoftware.com/wiki/Keyframe_rope)) Will return `nil` if the constraint or this rope segment could not be created.</ret> </rets> </function>