Flyby namespace lets you take control of the camera to create cinematic sequences. You can build a multi-step flyby by composing a list of FlybyEvent objects and passing them to Flyby.start(), or trigger a quick zoom-in on a specific block with Flyby.startZoomAt(). The camera moves smoothly between positions and returns to the player when the sequence ends.
Functions
Flyby.start
Starts a flyby sequence made up of one or more FlybyEvent steps. The camera moves through each event in order.
FlybyEvent objects. You create each event using the static factory methods on the FlybyEvent class described below.
Flyby.startZoomAt
Starts a quick zoom-in, hold, and return sequence focused on a specific location. You can identify the target by a BlockSlot object or by raw x, y, z coordinates.
| Parameter | Type | Description |
|---|---|---|
slot / x, y, z | BlockSlot / integer | Target block, by slot or grid coordinates. |
face | Face | Which face of the block the camera looks toward. |
orientation | Orientation | Camera roll orientation at the target. |
look | CameraLookPosition | How the camera looks at the target position. |
goingDuration | number | Seconds to travel from player to target. |
waitDuration | number | Seconds to hold at the target. |
returnDuration | number | Seconds to travel back to the player. |
FlybyEvent Class
AFlybyEvent represents one step in a flyby sequence. You never construct events with FlybyEvent.new; instead you use the static factory methods below. All factory methods return a FlybyEvent that you add to the array passed to Flyby.start().
Properties
| Property | Type | Description |
|---|---|---|
event.type | integer | Numeric type identifier of the event. |
event.isFinished | boolean | true once this event has played through. |
Instance Methods
FlybyEvent:toFlybyEvent
Converts this object to a FlybyEvent. Useful when you hold a subclass reference and need to pass a base FlybyEvent to an API that requires it.
Factory Methods
FlybyEvent.rawMoveTo
Moves the camera to an exact world position and rotation.
FlybyEvent.moveTo
Moves the camera to a block face, identified either by a BlockSlot or by grid coordinates.