← Documentation Home

BodyIsColliding

Category: 2D Game Physics (Pro)

Back to System Functions


Signature

BodyIsColliding(body As Integer)

Returns

Boolean

Description

Returns True when the body touched another body during the most recent physics step.

Performance and behavior

This is convenient for grounded and impact checks. Use BodyCollisionCount and BodyCollisionOther when the identity of the other body matters.

Pro feature: compiling code that uses this function requires a license with the GamePhysics feature enabled.

Example

If BodyIsColliding(player) Then grounded = True