constraint.RemoveAll

From Garry's Mod
Jump to: navigation, search
 constraint.RemoveAll( )

Contents

Description

Attempts to remove all constraints associated with an entity

Arguments

Entity ent

The entity to remove constraints from

Returns

boolean

Whether any constraints were removed

Returns

number

Number of constraints removed

Examples

Example

From stools/remover.lua

-- Reload removes all constraints on the targetted entity
function TOOL:Reload( trace )
	if ( !IsValid( trace.Entity ) or trace.Entity:IsPlayer() ) then return false end
	return constraint.RemoveAll( trace.Entity )
end


Personal tools
Navigation