Garry's Mod Wiki

constraint.Axis

  Entity constraint.Axis( Entity ent1, Entity ent2, number bone1, number bone2, Vector localPos1, Vector localPos2, number forceLimit = 0, number torqueLimit = 0, number friction = 0, number noCollide = 0, Vector localAxis = nil, boolean dontAddTable = false )

Description

Creates an axis constraint.

Arguments

1 Entity ent1
First entity.
2 Entity ent2
Second entity.
3 number bone1
PhysObj number of first entity to constrain to. (0 for non-ragdolls).

See Entity:TranslateBoneToPhysBone.

4 number bone2
PhysObj number of second entity to constrain to. (0 for non-ragdolls).

See Entity:TranslateBoneToPhysBone.

5 Vector localPos1
Position relative to the the first physics object to constrain to.
6 Vector localPos2
Position relative to the the second physics object to constrain to.
7 number forceLimit = 0
Amount of force until it breaks (0 = unbreakable)
8 number torqueLimit = 0
Amount of torque (rotational force) until it breaks (0 = unbreakable)
9 number friction = 0
Constraint friction.
10 number noCollide = 0
Whether the entities should be no-collided.
11 Vector localAxis = nil
If you include the LocalAxis then LPos2 will not be used in the final constraint. However, LPos2 is still a required argument.
12 boolean dontAddTable = false
Whether or not to add the constraint info on the entity table. See constraint.AddConstraintTable.

Returns

1 Entity
The created constraint. (phys_hinge) Will return false if the constraint could not be created.