Skip to main content
The Ball class represents the player-controlled ball entity in a RollingQuest level. You receive a Ball instance as the self parameter in ball-specific hooks such as OnUpdate, OnLand, and OnJump. Through it you can read the ball’s current state, change movement behaviour, manage linked balls, apply status effects, and kill the ball with a custom cause.

Identity

Transform

State

Methods

kill

Kills the ball after a delay. Three overloads are available:

instaKill

Kills the ball immediately without a delay. Three overloads mirror kill:

teleportToSide

Teleports the ball to the given side and facing orientation. Returns true on success.

doMove

Forces the ball to perform a specific movement action.

increaseJumpMode / decreaseJumpMode

Step the ball’s jumpMode up or down through Banned → Normal → Bouncing.

increaseJumpAheadDistance / decreaseJumpAheadDistance

Adjust how far ahead the ball travels on a jump.

increaseJumpUpDistance / decreaseJumpUpDistance

Adjust the vertical height of the ball’s jump.

changeGravity

Redirects gravity to the specified face of the current block. Returns true when the change succeeds.

enableShield / increaseShieldTime

Grant or extend the ball’s protective shield by seconds.

addBurningAmount

Adds to the ball’s current burning accumulator.

linkBall / unlinkBall / unlinkAllBalls

Manage cooperative links between balls. Linked balls share certain movement events.

isBallLinked

Returns true when this ball is linked to ball.

getLinkedBalls / getLinkedBallsIterator

getLinkedBalls returns a table; getLinkedBallsIterator returns an iterator-compatible form for use in for loops.

setRespawnLocation

Two overloads let you pin the respawn point to a side or to a specific block slot + face:

collectItem

Forces the ball to collect the specified item immediately.

Type-cast helpers

Every entity exposes a set of as* methods. Call them when you hold a generic entity reference and need to narrow its type. Each throws an error if the cast is invalid.

BallData

BallData is the raw, mutable representation of a ball used when building or modifying level data (e.g. in OnLevelLoad). It holds the initial spawn position, scripting fields, and design-time properties. Call clear() to reset a BallData instance to empty defaults.

Usage Example

The following OnUpdate hook reads the ball’s position every frame and kills it instantly when it falls below y = –20: