Use this class to set SceneView Camera properties.
// Create a folder (right click in the Assets directory, click Create>Folder) // and name it Editor if one doesn't exist already. Create a new C# script called CustomSettings // and place it in that folder.
// This script creates a new menu item Edit>SceneView Settings>Update Camera Settings in the main menu. // Use it to update the Camera settings in the Scene view.
using UnityEditor;
public class CustomSettings { [MenuItem("Edit/SceneView Settings/Update Camera Settings")] static void UpdateCameraSettings() { SceneView.CameraSettings settings = new SceneView.CameraSettings(); settings.accelerationEnabled = false; settings.speedMin = 1f; settings.speedMax = 10f; settings.speed = 5f; settings.easingEnabled = true; settings.easingDuration = 0.6f; settings.dynamicClip = false; settings.fieldOfView = 120f; settings.nearClip = 0.01f; settings.farClip = 1000f; settings.occlusionCulling = true; SceneView sceneView = SceneView.lastActiveSceneView; sceneView.cameraSettings = settings; } }
accelerationEnabled | Enables Camera movement acceleration in the SceneView. This makes the Camera accelerate for the duration of movement. |
dynamicClip | When enabled, the SceneView Camera's near and far clipping planes are calculated relative to the viewport size of the Scene. When disabled, nearClip and farClip are used instead. |
easingDuration | How long it takes for the speed of the SceneView Camera to accelerate to its initial full speed. Measured in seconds. Valid values are between [0.1, 2]. |
easingEnabled | Enables Camera movement easing in the SceneView. This makes the Camera ease in when it starts moving, and ease out when it stops. |
farClip | The furthest point from the SceneView Camera that drawing occurs. The valid minimum value is 0.02. |
fieldOfView | The height of the view angle for the SceneView Camera. Measured in degrees vertically, or along the local Y axis. |
nearClip | The closest point to the SceneView Camera where drawing occurs. The valid minimum value is 0.01. |
occlusionCulling | Enables occlusion culling in the SceneView. This prevents Unity from rendering GameObjects that the Camera cannot see because they are hidden by other GameObjects. |
speed | The speed of the SceneView Camera. |
speedMax | The maximum speed of the SceneView Camera. Valid values are between [0.0002, 10000]. |
speedMin | The minimum speed of the SceneView Camera. Valid values are between [0.0001, 9999]. |
speedNormalized | The normalized speed of the SceneView Camera, relative to the current minimum/maximum range. Valid values are between [0, 1]. |
SceneView.CameraSettings | Create a new CameraSettings object. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.