• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Camera

    Inherits from:

    Camera in Unity acts as the player's viewpoint into the game world, capturing scenes much like a real camera. It defines the field of view, perspective, and what is visible on the screen. Cameras can transform between world and screen space, control projection settings for depth and perspective, specify rendering settings, and manage culling properties. For comprehensive functionalities, explore Unity's Camera documentation. Unity's Camera Documentation

    Properties

    allCamerasCount

    number
    ClientOnly
    ReadOnly

    Gives the count of all enabled Cameras within the Scene. Unity's Camera.allCamerasCount Documentation

    allowDynamicResolution

    boolean
    ClientOnly

    Allows dynamic resolution adjustment for performance optimization. Unity's Camera.allowDynamicResolution Documentation

    allowHDR

    boolean
    ClientOnly

    Controls if the Camera uses High Dynamic Range rendering for enhanced visual details. Unity's Camera.allowHDR Documentation

    allowMSAA

    boolean
    ClientOnly

    Enables or disables Multi-Sample Anti-Aliasing for smoother image edges. Unity's Camera.allowMSAA Documentation

    anamorphism

    number
    ClientOnly

    Creates anamorphic lens effects by compressing the image in one dimension. Unity's Camera.anamorphism Documentation

    aperture

    number
    ClientOnly

    Emulates the aperture of a physical camera, impacting light intake and depth of field. Unity's Camera.aperture Documentation

    aspect

    number
    ClientOnly

    Sets the aspect ratio (width/height) for the Camera. Unity's Camera.aspect Documentation

    Sets the background color for the Camera's view. Unity's Camera.backgroundColor Documentation

    barrelClipping

    number
    ClientOnly

    Determines the clipping level for light entering the camera, affecting edge brightness. Unity's Camera.barrelClipping Documentation

    bladeCount

    number
    ClientOnly

    Sets the number of diaphragm blades, affecting the shape of out-of-focus areas. Unity's Camera.bladeCount Documentation

    Provides a matrix transforming from camera space to world space. Unity's Camera.cameraToWorldMatrix Documentation

    Clears the stencil buffer after lighting pass as an optimization. Unity's Camera.clearStencilAfterLightingPass Documentation

    cullingMask

    number
    ClientOnly

    Bit mask for rendering GameObjects on specific Layers. Unity's Camera.cullingMask Documentation

    Custom projection matrix for the Camera to adjust rendering. Unity's Camera.cullingMatrix Documentation

    current

    ClientOnly
    ReadOnly

    Retrieves the currently rendering Camera, useful for effects and scripts during rendering. Unity's Camera.current Documentation

    Simulates lens curvature, affecting perspective distortion in the rendered image. Unity's Camera.curvature Documentation

    depth

    number
    ClientOnly

    Specifies the Camera's depth in the rendering order. Unity's Camera.depth Documentation

    eventMask

    number
    ClientOnly

    Bit mask to selectively ignore GameObjects when sending events. Unity's Camera.eventMask Documentation

    farClipPlane

    number
    ClientOnly

    Sets the maximum distance up to which the Camera renders objects in the scene. Unity's Camera.farClipPlane Documentation

    fieldOfView

    number
    ClientOnly

    Manages the vertical extent of the scene visible at any moment, measured in degrees. Unity's Camera.fieldOfView Documentation

    focalLength

    number
    ClientOnly

    Represents the focal length of the camera lens, affecting the field of view. Unity's Camera.focalLength Documentation

    focusDistance

    number
    ClientOnly

    Adjusts the distance to the focus plane, useful for depth of field effects. Unity's Camera.focusDistance Documentation

    forceIntoRenderTexture

    boolean
    ClientOnly

    Forces Camera's view to always render to a texture for advanced image processing. Unity's Camera.forceIntoRenderTexture Documentation

    iso

    number
    ClientOnly

    Simulates the ISO setting of a physical camera, affecting image brightness and noise. Unity's Camera.iso Documentation

    kMaxAperture

    number
    ClientOnly
    ReadOnly

    Defines the maximum logical aperture size for camera simulations, affecting depth of field and light intake. Unity's Camera.kMaxAperture Documentation

    kMaxBladeCount

    number
    ClientOnly
    ReadOnly

    Sets the maximum number of aperture blades for detailed bokeh simulation in camera effects. Unity's Camera.kMaxBladeCount Documentation

    kMinAperture

    number
    ClientOnly
    ReadOnly

    Specifies the minimum logical aperture size for cameras, constraining physical camera simulations. Unity's Camera.kMinAperture Documentation

    kMinBladeCount

    number
    ClientOnly
    ReadOnly

    Indicates the minimum number of aperture blades for simulating camera bokeh effects. Unity's Camera.kMinBladeCount Documentation

    layerCullSpherical

    boolean
    ClientOnly

    Uses spherical bounds for layer culling computation when enabled. Unity's Camera.layerCullSpherical Documentation

    Allows shifting the lens in relation to the sensor, correcting for keystone distortion. Unity's Camera.lensShift Documentation

    main

    ClientOnly
    ReadOnly

    Accesses the main Camera in the scene, designated by the 'MainCamera' tag. Unity's Camera.main Documentation

    nearClipPlane

    number
    ClientOnly

    Defines the closest distance at which the Camera starts rendering objects. Unity's Camera.nearClipPlane Documentation

    Gives a projection matrix without jittering for anti-aliasing. Unity's Camera.nonJitteredProjectionMatrix Documentation

    orthographic

    boolean
    ClientOnly

    Toggles between Perspective and Orthographic modes for the Camera. Unity's Camera.orthographic Documentation

    orthographicSize

    number
    ClientOnly

    Defines the size of the view in world units for Orthographic Cameras. Unity's Camera.orthographicSize Documentation

    overrideSceneCullingMask

    number
    ClientOnly

    Bit mask override for Scene culling on this Camera. Unity's Camera.overrideSceneCullingMask Documentation

    pixelHeight

    number
    ClientOnly
    ReadOnly

    Provides the height in pixels of the Camera's rendering area. Unity's Camera.pixelHeight Documentation

    pixelRect

    ClientOnly

    Defines the rectangle, in pixels, that the Camera renders to on the screen. Unity's Camera.pixelRect Documentation

    pixelWidth

    number
    ClientOnly
    ReadOnly

    Gives the width in pixels of the Camera's rendering area. Unity's Camera.pixelWidth Documentation

    Holds the matrix from multiplying the previous frame's projection matrix by its world-to-camera matrix, useful for effects needing historical comparison. Unity's Camera.previousViewProjectionMatrix Documentation

    Offers a custom projection matrix for perspective transformations. Unity's Camera.projectionMatrix Documentation

    rect

    ClientOnly

    Specifies the Camera's viewport rectangle, controlling which part of the screen it occupies. Unity's Camera.rect Documentation

    scaledPixelHeight

    number
    ClientOnly
    ReadOnly

    Retrieves the height of the Camera's image with the scaling factor applied. Unity's Camera.scaledPixelHeight Documentation

    scaledPixelWidth

    number
    ClientOnly
    ReadOnly

    Gets the width of the Camera's image after applying the scaling factor. Unity's Camera.scaledPixelWidth Documentation

    Imitates the physical dimensions of the camera sensor, affecting the angle of view. Unity's Camera.sensorSize Documentation

    shutterSpeed

    number
    ClientOnly

    Mimics a camera's shutter speed, influencing exposure and motion blur. Unity's Camera.shutterSpeed Documentation

    Custom axis for sorting transparent objects when using Custom Axis mode. Unity's Camera.transparencySortAxis Documentation

    Decides whether to use a jittered projection matrix for rendering transparent objects. Unity's Camera.useJitteredProjectionMatrixForTransparentRendering Documentation

    useOcclusionCulling

    boolean
    ClientOnly

    Determines if Unity performs occlusion culling for this Camera. Unity's Camera.useOcclusionCulling Documentation

    usePhysicalProperties

    boolean
    ClientOnly

    Enables physical camera settings to simulate real camera properties. Unity's Camera.usePhysicalProperties Documentation

    velocity

    ClientOnly
    ReadOnly

    Provides the Camera's velocity, useful for motion blur effects. Unity's Camera.velocity Documentation

    Allows setting a custom transformation from world space to camera space. Unity's Camera.worldToCameraMatrix Documentation

    Methods

    Creates a custom projection matrix for oblique near-plane clipping, useful for mirror reflections or water surfaces. Unity's Camera.CalculateObliqueMatrix Documentation

    Parameters

    clipPlane

    The clipping plane to align with.

    Returns

    The custom projection matrix.

    CopyFrom

    ClientOnly

    Copies settings from another Camera, including all properties and transformation matrices. Unity's Camera.CopyFrom Documentation

    Parameters

    other

    The source Camera to copy from.

    Returns

    void

    Calculates the focal length from a given vertical field of view and sensor size. Unity's Camera.FieldOfViewToFocalLength Documentation

    Parameters

    fieldOfView
    number

    The vertical field of view to convert.

    sensorSize
    number

    The vertical size of the sensor.

    Returns

    number

    The focal length corresponding to the given field of view.

    Converts focal length to vertical field of view for the Camera's sensor size. Unity's Camera.FocalLengthToFieldOfView Documentation

    Parameters

    focalLength
    number

    The focal length to convert.

    sensorSize
    number

    The vertical size of the sensor.

    Returns

    number

    The calculated vertical field of view.

    Calculates the field of view based on gate fitting, useful for matching physical camera settings. Unity's Camera.GetGateFittedFieldOfView Documentation

    Returns

    number

    The calculated field of view.

    Determines the lens shift required based on gate fitting, aiding in accurate camera simulation. Unity's Camera.GetGateFittedLensShift Documentation

    Returns

    The required lens shift.

    Converts a horizontal field of view to a vertical field of view based on the aspect ratio. Unity's Camera.HorizontalToVerticalFieldOfView Documentation

    Parameters

    horizontalFieldOfView
    number

    The horizontal field of view to convert.

    aspectRatio
    number

    The aspect ratio of the camera.

    Returns

    number

    The vertical field of view.

    Render

    ClientOnly

    Forces immediate rendering of the scene from this Camera's perspective. Unity's Camera.Render Documentation

    Returns

    void

    Parameters

    shader
    replacementTag
    string

    Returns

    void

    Reset

    ClientOnly

    Resets all Camera settings to their defaults, useful for reinitializing camera properties. Unity's Camera.Reset Documentation

    Returns

    void

    ResetAspect

    ClientOnly

    Resets the Camera's aspect ratio to the screen's aspect ratio, undoing any custom aspect ratio settings. Unity's Camera.ResetAspect Documentation

    Returns

    void

    Resets the Camera's culling matrix to the default, useful for undoing custom culling adjustments. Unity's Camera.ResetCullingMatrix Documentation

    Returns

    void

    Reverts the Camera's projection matrix to default, useful for standard perspective restoration. Unity's Camera.ResetProjectionMatrix Documentation

    Returns

    void

    Removes any replacement shader from the Camera, returning to standard rendering. Unity's Camera.ResetReplacementShader Documentation

    Returns

    void

    Reverts the Camera's transparency sort settings to the default state. Unity's Camera.ResetTransparencySortSettings Documentation

    Returns

    void

    Resets the Camera's world-to-camera matrix to the identity matrix, clearing any transformations. Unity's Camera.ResetWorldToCameraMatrix Documentation

    Returns

    void

    Creates a ray from the Camera through a screen point, primarily for object selection via raycasting. Unity's Camera.ScreenPointToRay Documentation

    Parameters

    point

    The screen point through which the ray passes.

    Returns

    The ray from the camera through the screen point.

    Creates a ray from the Camera through a screen point, primarily for object selection via raycasting. Unity's Camera.ScreenPointToRay Documentation

    Parameters

    point

    The screen point through which the ray passes.

    Returns

    The ray from the camera through the screen point.

    Transforms a point from screen space to normalized viewport space. Unity's Camera.ScreenToViewportPoint Documentation

    Parameters

    position

    The screen space point to convert.

    Returns

    The viewport space position.

    Converts a point from screen space into world space for this Camera, useful for interaction with game objects. Unity's Camera.ScreenToWorldPoint Documentation

    Parameters

    point

    The screen space position to convert.

    Returns

    The converted world space position.

    Parameters

    shader
    replacementTag
    string

    Returns

    void

    Converts a vertical field of view to a horizontal field of view based on the aspect ratio. Unity's Camera.VerticalToHorizontalFieldOfView Documentation

    Parameters

    verticalFieldOfView
    number

    The vertical field of view to convert.

    aspectRatio
    number

    The aspect ratio of the camera.

    Returns

    number

    The horizontal field of view.

    Converts a point from normalized viewport space to screen space. Unity's Camera.ViewportToScreenPoint Documentation

    Parameters

    position

    The viewport space point to convert.

    Returns

    The screen space position.

    Transforms a world space point to screen space, allowing UI alignment or visibility checks. Unity's Camera.WorldToScreenPoint Documentation

    Parameters

    point

    The world space position to convert.

    Returns

    The screen space representation of the point.

    Updated 9 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.