Garry's Mod Wiki

constraint.RemoveConstraints

boolean, number constraint.RemoveConstraints( Entity ent, string type )

Description

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

Arguments

1 Entity ent
The entity to check
2 string type
The constraint type to remove (eg. "Weld", "Elastic", "NoCollide")

Returns

1 boolean
Whether we removed any constraints or not
2 number
The amount of constraints removed

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

Page Links


Special Pages


Wikis

?

Render Time: 37ms

DB GetPage 2
Generate Html 12
SaveChanges (1) 9
Render Body 0
Render Sidebar 11