Garry's Mod Wiki

Entity:SetPhysConstraintObjects

Entity:SetPhysConstraintObjects( PhysObj Phys1, PhysObj Phys2 )

Description

When called on a constraint entity, sets the two physics objects to be constrained.

Usage is not recommended as the Constraint library provides easier ways to deal with constraints.

Arguments

1 PhysObj Phys1
The first physics object to be constrained.
2 PhysObj Phys2
The second physics object to be constrained.

Example

From constraint.lua

Constraint = ents.Create("phys_lengthconstraint") Constraint:SetPos( WPos1 ) Constraint:SetKeyValue( "attachpoint", tostring(WPos2) ) Constraint:SetKeyValue( "minlength", "0.0" ) Constraint:SetKeyValue( "length", length + addlength ) if ( forcelimit ) then Constraint:SetKeyValue( "forcelimit", forcelimit ) end if ( rigid ) then Constraint:SetKeyValue( "spawnflags", 2 ) end Constraint:SetPhysConstraintObjects( Phys1, Phys2 ) Constraint:Spawn() Constraint:Activate()

Page Links


Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 3
Generate Html 5
SaveChanges (1) 9
Render Body 0
Render Sidebar 13