← Documentation Home

SetPhysicsGravity

Category: 2D Game Physics (Pro)

Back to System Functions


Signature

SetPhysicsGravity(world As Integer, x As Double, y As Double)

Returns

Void

Description

Changes the constant acceleration applied to every dynamic body in a physics world.

Performance and behavior

Existing velocities are preserved. Positive Y accelerates bodies downward.

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

Example

SetPhysicsGravity world, 0, 600