constraint.RemoveConstraints

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

Contents

Description

Attempts to remove all constraints of a specified type associated with an entity

Arguments

Entity ent

The entity to check

Arguments

string type

The constraint type to remove (eg. "Weld", "Elastic", "NoCollide")

Returns

boolean

Whether we removed any constraints or not

Returns

number

The amount of constraints removed

Examples

Example

From stools/axis.lua

function TOOL:Reload( trace )
 if (!trace.Entity:IsValid() or trace.Entity:IsPlayer() ) then return false end
 local bool = constraint.RemoveConstraints( trace.Entity, "Axis" )
 return bool
end


Personal tools
Navigation