Garry's Mod Wiki

Entity:IsConstrained

Description

Returns true if the entity has constraints attached to it

This will only update clientside if the server calls it first. This only checks constraints added through the constraint so this will not react to map constraints.

Returns

1 boolean
Whether the entity is constrained or not.

Example

From entities/prop_effect.lua

function ENT:PhysicsUpdate( physobj ) if ( CLIENT ) then return end -- Don't do anything if the player isn't holding us if ( !self:IsPlayerHolding() && !self:IsConstrained() ) then physobj:SetVelocity( Vector(0,0,0) ) physobj:Sleep() end end

Page Links


Special Pages


Wikis

?

Render Time: 34ms

Session 0
DB GetPage 7
Generate Html 3
SaveChanges 15
Render Body 0
Render Sidebar 6