← Documentation Home

SetBodyVelocity

Category: 2D Game Physics (Pro)

Back to System Functions


Signature

SetBodyVelocity(body As Integer, x As Double, y As Double)

Returns

Void

Description

Sets a dynamic body's velocity in pixels per second.

Performance and behavior

Calls on static bodies have no effect.

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

Example

SetBodyVelocity player, 220, BodyVelocityY(player)