Skip to main content

CameraTour

This item only works when running on the client. Client

Flies the camera over a list of points of interest and puts it back exactly where it was.

Camera state is captured once when a tour starts and restored when it ends, whether it finished on its own or was stopped early. That is the whole reason this exists rather than a hand-rolled tween: an interrupted tour is the common case, and it is the one that strands players in a scriptable camera.

You normally reach this through Cinematic.

Types

TourStop

interface TourStop {
TargetBasePart--

What to look at

Holdnumber?--

Seconds to linger here. Falls back to the tour default

Distancenumber?--

How far back to sit. Falls back to the tour default

Heightnumber?--

How far above to sit. Falls back to the tour default

OnArrive(() → ())?--

Runs once the camera settles on this stop

}

One point of interest. Every field except Target falls back to the tour's config, so a stop only spells out what makes it different.

OnArrive is where you line up something with the camera, such as playing a sound or opening a caption as the landmark comes into view.

CameraTourConfig

interface CameraTourConfig {
Distancenumber?--

Default distance from a target. Defaults to 13.2

Heightnumber?--

Default height above a target. Defaults to 9

Holdnumber?--

Default seconds per stop. Defaults to 2.5

FocusDurationnumber?--

Seconds to travel between stops. Defaults to 1.5

EasingStyleEnum.EasingStyle?--

Easing for that travel

}

Framing defaults. Pass it as Camera in TutorialConfig.

Properties

Completed

events
CameraTour.Completed: Signal<()>

Fires when a tour ends, including when it was cut short by CameraTour:Stop or by a target being destroyed. Firing on interruption too is what lets Advance be safe to attach.

Functions

create

constructor
CameraTour.create(
configCameraTourConfig?--

Framing defaults

) → CameraTour

Creates a standalone camera tour. Tutorial.build already does this for you.

Errors

TypeDescription
"TutorialKit.CameraTour is client only"Called from the server

Play

CameraTour:Play(
stops{TourStop}--

Points of interest, visited in order

) → ()

Starts a tour, replacing any tour already running.

Focus

CameraTour:Focus(
targetBasePart,--

What to look at

holdnumber?--

Seconds to linger

) → ()

Shorthand for a tour with a single stop.

Stop

CameraTour:Stop() → ()

Ends the tour early and restores the camera. Fires CameraTour.Completed.

IsPlaying

CameraTour:IsPlaying() → boolean--

Whether a tour is running

Destroy

lifecycle
CameraTour:Destroy() → ()

Stops the tour, restores the camera and releases the signal. Tutorial:Destroy already does this for you.

Show raw api
{
    "functions": [
        {
            "name": "Play",
            "desc": "Starts a tour, replacing any tour already running.",
            "params": [
                {
                    "name": "stops",
                    "desc": "Points of interest, visited in order",
                    "lua_type": "{TourStop}"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 80,
                "path": "src/Guidance/CameraTour.luau"
            }
        },
        {
            "name": "Focus",
            "desc": "Shorthand for a tour with a single stop.",
            "params": [
                {
                    "name": "target",
                    "desc": "What to look at",
                    "lua_type": "BasePart"
                },
                {
                    "name": "hold",
                    "desc": "Seconds to linger",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 89,
                "path": "src/Guidance/CameraTour.luau"
            }
        },
        {
            "name": "Stop",
            "desc": "Ends the tour early and restores the camera. Fires [CameraTour.Completed].",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 96,
                "path": "src/Guidance/CameraTour.luau"
            }
        },
        {
            "name": "IsPlaying",
            "desc": "",
            "params": [],
            "returns": [
                {
                    "desc": "Whether a tour is running",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 102,
                "path": "src/Guidance/CameraTour.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Stops the tour, restores the camera and releases the signal. [Tutorial:Destroy] already does this\nfor you.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "tags": [
                "lifecycle"
            ],
            "source": {
                "line": 111,
                "path": "src/Guidance/CameraTour.luau"
            }
        },
        {
            "name": "create",
            "desc": "Creates a standalone camera tour. [Tutorial.build] already does this for you.",
            "params": [
                {
                    "name": "config",
                    "desc": "Framing defaults",
                    "lua_type": "CameraTourConfig?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CameraTour"
                }
            ],
            "function_type": "static",
            "tags": [
                "constructor"
            ],
            "errors": [
                {
                    "lua_type": "\"TutorialKit.CameraTour is client only\"",
                    "desc": "Called from the server"
                }
            ],
            "source": {
                "line": 139,
                "path": "src/Guidance/CameraTour.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "Completed",
            "desc": "Fires when a tour ends, including when it was cut short by [CameraTour:Stop] or by a target\nbeing destroyed. Firing on interruption too is what lets `Advance` be safe to attach.",
            "lua_type": "Signal<()>",
            "tags": [
                "events"
            ],
            "source": {
                "line": 72,
                "path": "src/Guidance/CameraTour.luau"
            }
        }
    ],
    "types": [
        {
            "name": "TourStop",
            "desc": "One point of interest. Every field except `Target` falls back to the tour's config, so a stop\nonly spells out what makes it different.\n\n`OnArrive` is where you line up something with the camera, such as playing a sound or opening a\ncaption as the landmark comes into view.",
            "fields": [
                {
                    "name": "Target",
                    "lua_type": "BasePart",
                    "desc": "What to look at"
                },
                {
                    "name": "Hold",
                    "lua_type": "number?",
                    "desc": "Seconds to linger here. Falls back to the tour default"
                },
                {
                    "name": "Distance",
                    "lua_type": "number?",
                    "desc": "How far back to sit. Falls back to the tour default"
                },
                {
                    "name": "Height",
                    "lua_type": "number?",
                    "desc": "How far above to sit. Falls back to the tour default"
                },
                {
                    "name": "OnArrive",
                    "lua_type": "(() -> ())?",
                    "desc": "Runs once the camera settles on this stop"
                }
            ],
            "source": {
                "line": 37,
                "path": "src/Guidance/CameraTour.luau"
            }
        },
        {
            "name": "CameraTourConfig",
            "desc": "Framing defaults. Pass it as `Camera` in [TutorialConfig].",
            "fields": [
                {
                    "name": "Distance",
                    "lua_type": "number?",
                    "desc": "Default distance from a target. Defaults to 13.2"
                },
                {
                    "name": "Height",
                    "lua_type": "number?",
                    "desc": "Default height above a target. Defaults to 9"
                },
                {
                    "name": "Hold",
                    "lua_type": "number?",
                    "desc": "Default seconds per stop. Defaults to 2.5"
                },
                {
                    "name": "FocusDuration",
                    "lua_type": "number?",
                    "desc": "Seconds to travel between stops. Defaults to 1.5"
                },
                {
                    "name": "EasingStyle",
                    "lua_type": "Enum.EasingStyle?",
                    "desc": "Easing for that travel"
                }
            ],
            "source": {
                "line": 56,
                "path": "src/Guidance/CameraTour.luau"
            }
        }
    ],
    "name": "CameraTour",
    "desc": "Flies the camera over a list of points of interest and puts it back exactly where it was.\n\nCamera state is captured once when a tour starts and restored when it ends, whether it finished\non its own or was stopped early. That is the whole reason this exists rather than a hand-rolled\ntween: an interrupted tour is the common case, and it is the one that strands players in a\nscriptable camera.\n\nYou normally reach this through [Cinematic].",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 15,
        "path": "src/Guidance/CameraTour.luau"
    }
}