Garry's Mod Wiki

Entity:GetConstrainedPhysObjects

Description

Returns the two entities physobjects involved in a constraint ent, or no value if the entity is not a constraint.

Returns

1 PhysObj
phys1
2 PhysObj
phys2

Example

From gmsave/constraints.lua

function gmsave.ConstraintSave( ent ) local t = {} t.EntOne, t.EntTwo = ent:GetConstrainedEntities() local PhysA, PhysB = ent:GetConstrainedPhysObjects() t.BoneOne = GetPhysicsObjectNum( t.EntOne, PhysA ) t.BoneTwo = GetPhysicsObjectNum( t.EntTwo, PhysB ) t.EntOne = gmsave.EntityEncode( t.EntOne ) t.EntTwo = gmsave.EntityEncode( t.EntTwo ) return t end

Page Links


Special Pages


Wikis

?

Render Time: 28ms

Session 0
DB GetPage 3
Generate Html 4
SaveChanges 8
Render Body 0
Render Sidebar 11