Entity/OnGround

From Garry's Mod
Jump to: navigation, search
 Entity:OnGround( )

Contents

Description

Returns true if the entity is on the ground, and false if it isn't.

Internally, this checks if FL_ONGROUND is set on the entity. This is only updated for players and NPCs, and thus won't inherently work for other entities.

Returns

boolean

Whether the entity is on the ground or not.

Examples

Example

Prints if Entity(1) is on the ground or not.

print( Entity( 1 ):OnGround() )
print( Entity( 1 ):IsFlagSet( FL_ONGROUND ) ) -- This should give exact same output as the first line

Output:

In most cases, true.
Personal tools
Navigation