The Two Ways to Start a Flyby
TheFlyby namespace exposes two functions:
Flyby.startZoomAt — Simple Zoom to a Block
startZoomAt is the quickest way to show the player a specific block. You give it a location, how the camera should face that block, and three durations.
Signatures
Parameters Explained
slot / x, y, z — The target block’s position. BlockSlot is an object with integer x, y, z fields; you can also construct one with BlockSlot.new(x, y, z).
face: Face — Which face of the block the camera looks at. Combines with orientation to determine the exact camera angle.
orientation: Orientation — The compass rotation of the camera view when looking at the chosen face.
look: CameraLookPosition — Vertical tilt of the camera.
goingDuration — Seconds the camera takes to travel to the target.
waitDuration — Seconds the camera holds at the target before returning.
returnDuration — Seconds the camera takes to travel back to the ball.
Flyby.start — Full Custom Sequence
For multi-stop sequences, build an array of FlybyEvent objects and pass them to Flyby.start.
FlybyEvent Static Constructors
Each factory returns a
FlybyEvent you insert into the events array passed to Flyby.start.
FlybyEvent Properties
Example 1 — Show the Exit on Level Start
Attach this script to the Level entity. When the level starts, the camera zooms to the exit block (assumed to be at grid position 8, 0, 8), waits for 2 seconds so the player can see it, then returns. A closeable dialog prompt replaces the standard UI until the player dismisses it.Level.delayAction does not pause the flyby — both run concurrently. Calculate the total flyby duration (goingDuration + waitDuration + returnDuration) and use that as your delay so the dialog appears only after the camera has fully returned.Example 2 — Multi-Stop Cinematic Intro
This example builds a three-stop sequence: the camera starts at the key pickup area, moves to the exit, shows a message, then returns to the ball.Key Things to Remember
BlockSlotis the grid coordinate type used byFlyby.startZoomAtandFlybyEvent.moveTo. Create one withBlockSlot.new(x, y, z)or read it from any entity’s.blockSlotproperty (for example,Level.currentBall.blockSlot).FaceandOrientationtogether control the exact camera angle. Experiment withFace.Up+Orientation.Northas a starting point — it gives a top-down bird’s-eye view.CameraLookPositionadds a vertical tilt:Downis useful for showing something on the floor of the block,Upfor something on the ceiling.