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 mirrorkill:
teleportToSide
true on success.
doMove
increaseJumpMode / decreaseJumpMode
jumpMode up or down through Banned → Normal → Bouncing.
increaseJumpAheadDistance / decreaseJumpAheadDistance
increaseJumpUpDistance / decreaseJumpUpDistance
changeGravity
true when the change succeeds.
enableShield / increaseShieldTime
seconds.
addBurningAmount
linkBall / unlinkBall / unlinkAllBalls
isBallLinked
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
Type-cast helpers
Every entity exposes a set ofas* 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 followingOnUpdate hook reads the ball’s position every frame and kills it instantly when it falls below y = –20: