constraint.GetAllConstrainedEntities

From GMod Wiki

Revision as of 05:08, 30 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax constraint.GetAllConstrainedEntities( Entity Entity )
Where is this used?
Description:
Returns the table with information about the constraints on an entity.
Returns: Table
Part of Library: constraint
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Constraint.GetAllConstrainedEntities]Constraint.GetAllConstrainedEntities [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionGet all Constrained Entities from a Entity
Used onNewerServer.png
Code
local ConstrainedEntities = constraint.GetAllConstrainedEntities( Entity )
 
// Loop through all the entities in the system
for _, ent in pairs( ConstrainedEntities ) do
	// constr.Constraint is the actual constraint.
	// constr.Entity is a table of each Entity connected to the constraint.
	// it includes these items.
	// constr.Entity[1].Index number
	// constr.Entity[1].Entity entity
	// constr.Entity[1].Bone number
	// constr.Entity[1].LPos vector
	// constr.Entity[1].WPos vector
	// constr.Entity[1].Length number
	// constr.Entity[1].World boolean 
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox