← Documentation Home

BodyCollisionCount

Category: 2D Game Physics (Pro)

Back to System Functions


Signature

BodyCollisionCount(body As Integer)

Returns

Integer

Description

Returns the number of bodies touching this body during the most recent physics step.

Performance and behavior

Contacts are zero-based when read with BodyCollisionOther. Invalid handles return 0.

Pro feature: requires GamePhysics.

Example

If BodyCollisionCount(player) > 0 Then grounded = True