Hello there,
Is it possible to change the near clipping plane of the scene camera without focusing an object. I tried to change the near clipping plane via script, but when used as a handle it just clips gizmos (See gif). I also tried to set it via an own window, but in that case the change of the near clipping plane had no effect at all.

Here is the window script:
using UnityEngine;
using UnityEditor;
public class NearClippingEditorWindow : EditorWindow
{
private static float nearClipping;
[MenuItem("Window/Scene Camera clipping")]
static void Init()
{
NearClippingEditorWindow window = (NearClippingEditorWindow)EditorWindow.GetWindow(typeof(NearClippingEditorWindow));
window.Show();
}
void OnFocus()
{
var sceneCamera = SceneView.lastActiveSceneView.camera;
if (sceneCamera == null)
{
Debug.Log("Scene Camera not found");
return;
}
nearClipping = sceneCamera.nearClipPlane;
}
void OnGUI()
{
GUILayout.Label("Scene Camera", EditorStyles.boldLabel);
var sceneCamera = SceneView.lastActiveSceneView.camera;
if (sceneCamera == null)
{
Debug.Log("Scene Camera not found");
return;
}
nearClipping = EditorGUILayout.Slider("Near clipping", nearClipping, 0.01f, 100f);
sceneCamera.nearClipPlane = nearClipping;
SceneView.lastActiveSceneView.Repaint();
}
}
I think I am getting the correct camera, but my changes seem to have no effect. Any ideas what went wrong? I also attached the project to the post.
2957267–219414–EditorCamera.zip (39.1 KB)