← Documentation Home

SetBodyPosition

Category: 2D Game Physics (Pro)

Back to System Functions


Signature

SetBodyPosition(body As Integer, x As Integer, y As Integer)

Returns

Void

Description

Moves a body center immediately to an integer game coordinate.

Performance and behavior

Velocity is preserved. Use this for teleports or respawning, not for ordinary frame-by-frame movement.

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

Example

SetBodyPosition player, 120, 200