docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method FitCamera

    FitCamera(Point3, CameraType, double, int, OccurrenceList)

    Set the viewer matrices to adjust the camera to the scene

    Declaration
    [HandleProcessCorruptedStateExceptions]
    public void FitCamera(Point3 direction, CameraType cameraType = CameraType.Orthographic, double fov = 90, int viewer = -1, OccurrenceList fitToOccurrences = null)
    Parameters
    Type Name Description
    Point3 direction

    Camera direction

    CameraType cameraType

    Camera type, Orthographic or Perspective

    double fov

    Field of view (perspective mode only)

    int viewer

    Viewer id returned by the createViewer function. -1 uses the default viewer id (see setDefaultViewerId).

    OccurrenceList fitToOccurrences
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)