Garry's Mod Wiki

Entity:OnGround

  boolean Entity:OnGround()

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

1 boolean
Whether the entity is on the ground or not.

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.