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.

CameraState

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

The current state.

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

OverrideGlobalFieldOfView

DefaultCamera:OverrideGlobalFieldOfView(fieldOfViewnumber) → ()

Overrides the global field of view in the cached camera state

BindToRenderStep

DefaultCamera:BindToRenderStep() → ()

Binds the camera to RunService RenderStepped event.

tip

Be sure to call UnbindFromRenderStep when using this.

UnbindFromRenderStep

DefaultCamera:UnbindFromRenderStep() → ()

Unbinds the camera from the RunService

Destroy

DefaultCamera:Destroy() → ()

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": 26,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "OverrideGlobalFieldOfView",
            "desc": "Overrides the global field of view in the cached camera state",
            "params": [
                {
                    "name": "fieldOfView",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 43,
                "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": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 58,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "UnbindFromRenderStep",
            "desc": "Unbinds the camera from the RunService",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 73,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the binding",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 81,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "CameraState",
            "desc": "The current state.",
            "lua_type": "CameraState",
            "readonly": true,
            "source": {
                "line": 50,
                "path": "src/camera/src/Client/Effects/HeartbeatCamera.lua"
            }
        },
        {
            "name": "CameraState",
            "desc": "The current state.",
            "lua_type": "CameraState",
            "readonly": true,
            "source": {
                "line": 91,
                "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
            }
        },
        {
            "name": "CameraState",
            "desc": "The current state.",
            "lua_type": "CameraState",
            "readonly": true,
            "source": {
                "line": 60,
                "path": "src/camera/src/Client/Effects/ImpulseCamera.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": 8,
        "path": "src/camera/src/Client/Effects/DefaultCamera.lua"
    }
}