Garry's Mod Wiki

constraint.Weld

Entity constraint.Weld( Entity ent1, Entity ent2, number bone1, number bone2, number forcelimit, boolean nocollide, boolean deleteent1onbreak )

Description

Creates a weld constraint

Arguments

1 Entity ent1
The first entity
2 Entity ent2
The second entity
3 number bone1
The bonenumber of the first entity (0 for monoboned entities) <br> <br> PhysObj number for ragdolls, see: Entity:TranslateBoneToPhysBone.
4 number bone2
The bonenumber of the second entity
5 number forcelimit
The amount of force appliable to the constraint before it will break (0 is never)
6 boolean nocollide
Should ent1 be nocollided to ent2 via this constraint
7 boolean deleteent1onbreak
If true, when ent2 is removed, ent1 will also be removed

Returns

1 Entity
constraint

Example

Adapted from stools/thruster.lua

function TOOL:LeftClick( trace ) /* Boilerplate stool code to extract ClientConVars to variables */ local thruster = MakeThruster( ply, model, Ang, trace.HitPos, key, key_bk, force, toggle, effect, damageable, soundname ) local weld = constraint.Weld( thruster, trace.Entity, 0, trace.PhysicsBone, 0, collision == 0, true ) -- If you remove the entity thrusters are welded to, the thruster is removed as well end

Page Links


Special Pages


Wikis

?

Render Time: 51ms

Session 0
DB GetPage 3
Generate Html 26
SaveChanges 9
Render Body 0
Render Sidebar 11