Skip to main content

DefaultCamera

Hack to maintain default camera control by binding before and after the camera update cycle. This allows other cameras to build off of the "default" camera while maintaining the same Roblox control scheme.

This camera is automatically setup by the CameraStackService.

Properties​

CameraState​

This item is read only and cannot be modified. Read Only
DefaultCamera.CameraState: CameraState

The current state.

Functions​

new​

DefaultCamera.new() → DefaultCamera

Constructs a new DefaultCamera

SetRobloxFieldOfView​

DefaultCamera.SetRobloxFieldOfView(
fieldOfView: number
) → ()

Overrides the global field of view in the cached camera state

SetRobloxCameraState​

DefaultCamera.SetRobloxCameraState(
cameraState: CameraState
) → ()

Sets the Roblox camera state to look at things

SetRobloxCFrame​

DefaultCamera.SetRobloxCFrame(
cframe: CFrame
) → ()

Sets the CFrame of the Roblox Camera

GetRobloxCameraState​

DefaultCamera.GetRobloxCameraState(self: DefaultCamera) → CameraState

Gets the current Roblox camera state, free of any influence

SetLastSetCameraFrame​

DefaultCamera.SetLastSetCameraFrame(
cameraFrame: CameraState | nil
) → ()

Sets the camera state different

IsFirstPerson​

DefaultCamera.IsFirstPerson(self: DefaultCamera) → boolean

Gets whether the Roblox camera is in first person

ObserveIsFirstPerson​

DefaultCamera.ObserveIsFirstPerson(self: DefaultCamera) → Observable<boolean>

Gets whether the Roblox camera is in first person

ObserveIsFirstPersonBrio​

DefaultCamera.ObserveIsFirstPersonBrio(
predicate: ((inFirstPerson: boolean) → boolean)?
) → Observable<Brio<boolean>>

Gets whether the Roblox camera is in first person

BindToRenderStep​

DefaultCamera.BindToRenderStep(self: DefaultCamera) → Maid.Maid

Binds the camera to RunService RenderStepped event.

TIP

Be sure to call UnbindFromRenderStep when using this.

UnbindFromRenderStep​

DefaultCamera.UnbindFromRenderStep(self: DefaultCamera) → ()

Unbinds the camera from the RunService

Destroy​

DefaultCamera.Destroy(self: DefaultCamera) → ()

Cleans up the binding

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new DefaultCamera",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 50,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "SetRobloxFieldOfView",
            "desc": "Overrides the global field of view in the cached camera state",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                },
                {
                    "name": "fieldOfView",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 70,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "SetRobloxCameraState",
            "desc": "Sets the Roblox camera state to look at things",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                },
                {
                    "name": "cameraState",
                    "desc": "",
                    "lua_type": "CameraState"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 82,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "SetRobloxCFrame",
            "desc": "Sets the CFrame of the Roblox Camera",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                },
                {
                    "name": "cframe",
                    "desc": "",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 94,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "GetRobloxCameraState",
            "desc": "Gets the current Roblox camera state, free of any influence",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CameraState"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 107,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "SetLastSetCameraFrame",
            "desc": "Sets the camera state different",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                },
                {
                    "name": "cameraFrame",
                    "desc": "",
                    "lua_type": "CameraState | nil"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 116,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "IsFirstPerson",
            "desc": "Gets whether the Roblox camera is in first person",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 123,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "ObserveIsFirstPerson",
            "desc": "Gets whether the Roblox camera is in first person",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 132,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "ObserveIsFirstPersonBrio",
            "desc": "Gets whether the Roblox camera is in first person",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                },
                {
                    "name": "predicate",
                    "desc": "",
                    "lua_type": "((inFirstPerson: boolean) -> boolean)?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<boolean>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 142,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "BindToRenderStep",
            "desc": "Binds the camera to RunService RenderStepped event.\n\n:::tip\nBe sure to call UnbindFromRenderStep when using this.\n:::",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Maid.Maid\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 153,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "UnbindFromRenderStep",
            "desc": "Unbinds the camera from the RunService",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 209,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the binding",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "DefaultCamera"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 216,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "CameraState",
            "desc": "The current state.",
            "lua_type": "CameraState",
            "readonly": true,
            "source": {
                "line": 226,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        }
    ],
    "types": [],
    "name": "DefaultCamera",
    "desc": "Hack to maintain default camera control by binding before and after the camera update cycle.\nThis allows other cameras to build off of the \"default\" camera while maintaining the same Roblox control scheme.\n\nThis camera is automatically setup by the [CameraStackService](/api/CameraStackService).",
    "source": {
        "line": 9,
        "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
    }
}