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.

Page Links


Special Pages


Wikis

?

Render Time: 72ms

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