Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Scene editor camera is cutting off my objects

Discussion in 'Editor & General Support' started by stefanwillems, Nov 22, 2016.

  1. stefanwillems

    stefanwillems

    Joined:
    Nov 2, 2016
    Posts:
    42
    hello everyone.

    while in my scene. (not game!) the display is bugging. upload_2016-11-22_11-4-14.png
    as you can see. my scene camera is like 10meters away from the object but they are disapearing...

    how can i fix this?
     

    Attached Files:

    SamuelE likes this.
  2. mark_cb

    mark_cb

    Joined:
    Jun 9, 2015
    Posts:
    17
    This is caused by the near clip plane being too far away. I believe the near clip is adjusted each time you focus the camera on an object (by selecting something and pressing F). It does so based on the size of what you're asking to focus on. If you've got a huge mesh and focussed on it, the scene camera will have pulled right out to fit it all in view and adjusted the clip plane accordingly.

    So, select something small and press F. See if that fixes things for you.
     
  3. stefanwillems

    stefanwillems

    Joined:
    Nov 2, 2016
    Posts:
    42
    this fixed it for me! huge thanks to u my friend!
     
  4. jsuper10

    jsuper10

    Joined:
    May 8, 2017
    Posts:
    1
    Iso.JPG Just change to Persp
     
  5. kubaka

    kubaka

    Joined:
    Jan 3, 2019
    Posts:
    2
    Thank you @mark_cb from 2016! Your answer is still helping people 2019!
     
  6. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    85
    ya it just helped me, i selected a object and pressed F which fixed the clipping issue. ty so much
     
  7. ourearthandbeyond

    ourearthandbeyond

    Joined:
    Nov 29, 2019
    Posts:
    2
    Thank you very much, this fixed it for me also :)
     
  8. estephan500

    estephan500

    Joined:
    Sep 15, 2019
    Posts:
    1
    Yep, helps me in late 2019 also. But I have to admit, I haven't yet learned what a "clip plane" is or why a "near one" could be too far away. But using F on something small works... Maybe I will understand someday... note, my game is 2D... and a few simple rectangular objects were getting chopped off in the most illogical ways... :) Anyway, THANKS.
     
  9. LiamMitchell

    LiamMitchell

    Joined:
    Oct 30, 2015
    Posts:
    5
    Picked this up from a gist, very nice.
    Could be modified to do far also I think.

    Code (CSharp):
    1. // --------------------------------------------------------------------------------------------------------------------
    2. // <copyright file="SceneViewFocusChangerWindow.cs" company="Supyrb">
    3. //   Copyright (c) 2018 Supyrb. All rights reserved.
    4. // </copyright>
    5. // <author>
    6. //   Johannes Deml
    7. //   send@johannesdeml.com
    8. // </author>
    9. // --------------------------------------------------------------------------------------------------------------------
    10.  
    11. using UnityEditor;
    12. using UnityEngine;
    13.  
    14. namespace Supyrb
    15. {
    16.     /// <summary>
    17.     /// Handy little tool to quickly change the focus of unity to avoid clipping in the scene view
    18.     /// From https://forum.unity.com/threads/change-near-clipping-plane-scene-camera.456078/#post-3525716
    19.     /// And https://gist.github.com/JohannesDeml/47dde1617161acfcd533abb715475017
    20.     /// </summary>
    21.     public class SceneViewFocusChangerWindow : EditorWindow
    22.     {
    23.         private static float nearClipping;
    24.  
    25.         [MenuItem("Window/Scene Camera clipping")]
    26.         static void Init()
    27.         {
    28.             SceneViewFocusChangerWindow window = (SceneViewFocusChangerWindow)EditorWindow.GetWindow(typeof(SceneViewFocusChangerWindow));
    29.             window.Show();
    30.         }
    31.  
    32.         private void OnInspectorUpdate()
    33.         {
    34.             Repaint();
    35.         }
    36.  
    37.         void OnGUI()
    38.         {
    39.             EditorGUILayout.LabelField("Scene Camera near clipping", EditorStyles.boldLabel);
    40.             var lastSceneView = SceneView.lastActiveSceneView;
    41.             if (lastSceneView == null || lastSceneView.camera == null)
    42.             {
    43.                 EditorGUILayout.HelpBox("No Scene view found", MessageType.Error);
    44.                 return;
    45.             }
    46.  
    47.             nearClipping = lastSceneView.camera.nearClipPlane;
    48.             EditorGUI.BeginChangeCheck();
    49.             {
    50.                 nearClipping = EditorGUILayout.Slider("Near clipping", nearClipping, 0.01f, 20f);
    51.             }
    52.             if (EditorGUI.EndChangeCheck())
    53.             {
    54.                 lastSceneView.size = nearClipping * 100f;
    55.                 lastSceneView.Repaint();
    56.             }
    57.  
    58.             // Instant focus to a near position without caring about the last pivot
    59.             if (GUILayout.Button("Focus near"))
    60.             {
    61.                 lastSceneView.LookAt(lastSceneView.camera.transform.position + lastSceneView.camera.transform.forward * 3f, lastSceneView.rotation, 3f);
    62.             }
    63.         }
    64.     }
    65. }
     
  10. Rosuman

    Rosuman

    Joined:
    Jun 23, 2020
    Posts:
    1
    rajeshja likes this.
  11. hgreene624

    hgreene624

    Joined:
    May 19, 2020
    Posts:
    2
    2020!
     
  12. ScarabGameDev

    ScarabGameDev

    Joined:
    Apr 2, 2020
    Posts:
    6
    I had the same problem but the F key didn't fix this, after further investigation I found my problem was the Main Camera position being to low. After adjusting the height above the ground plane all works great now.
    Hope this help others.
    PyJai
     
    skalou likes this.
  13. loaikk9

    loaikk9

    Joined:
    Jan 13, 2021
    Posts:
    3
    Thank you!
     
  14. radpok

    radpok

    Joined:
    Jun 7, 2021
    Posts:
    1
  15. submesh

    submesh

    Joined:
    Sep 16, 2021
    Posts:
    1
    In the screenshot he's already in perspective mode, but doing what you said fixed my clipping issue so thanks.
     
  16. DiniduRashmika

    DiniduRashmika

    Joined:
    Aug 3, 2021
    Posts:
    2
    thanks bro..
     
  17. Bundook

    Bundook

    Joined:
    Apr 28, 2019
    Posts:
    1
    And in 2021
     
  18. pixelR

    pixelR

    Joined:
    Sep 16, 2013
    Posts:
    58
    If hitting F doesn't work (like in my case in 2022.1.0b4), you can also just double click a gameobject in the scene hierarchy, it will do the trick.
     
  19. unity_2FB29CDC6096CC1F8371

    unity_2FB29CDC6096CC1F8371

    Joined:
    Mar 31, 2022
    Posts:
    1
    BRO THX
     
  20. JumpingGuy

    JumpingGuy

    Joined:
    Jan 2, 2016
    Posts:
    69
    I've been using Unity for years now and got stumped on this one. Lol. Thank you for the solution!
     
  21. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,771
    Just wondering, is there a way to auto adjust the clipping without reframing?
     
  22. epratt

    epratt

    Joined:
    Oct 15, 2019
    Posts:
    16
    I believe you can adjust it on the toolbar in the attached screenshot. This is with Unity 2021.3. You can use dynamic clipping or manually define clipping planes.
    Screenshot1.png

    This actually helped me with my issue because I was still seeing clipping after everyone else's suggestions and all I had to do was enable Dynamic Clipping
     
    LiquidGallium, petey and ThatRinDev like this.
  23. paoloyanes01

    paoloyanes01

    Joined:
    Sep 11, 2022
    Posts:
    1
    THANK YOU!
     
  24. shotCamPan

    shotCamPan

    Joined:
    Oct 31, 2022
    Posts:
    1
    I angerly deleted 20 min of work THEN I saw this. -_- haha thanks for the tip in 2022
     
  25. HardikaDoshi

    HardikaDoshi

    Joined:
    Apr 29, 2022
    Posts:
    5
    Resetting the Editor Layout helped me get rid of clipping in the Scene View.
    upload_2022-11-8_12-50-32.png
     
  26. WattefuxX

    WattefuxX

    Joined:
    Nov 30, 2022
    Posts:
    1
    Another Thank you and Greetings from 2023!
     
  27. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    283
    Hall of fame post. Just worked for me too.
     
  28. Taba_Denis

    Taba_Denis

    Joined:
    Mar 30, 2023
    Posts:
    1
  29. pyrypoikolainen

    pyrypoikolainen

    Joined:
    Apr 5, 2020
    Posts:
    2
    In addition to focusing on an object with F to reset the clipping planes, you can also manually set it to whatever you want by opening the Scene view camera settings from the top right corner of the Scene window, disabling Dynamic Clipping and setting your own Near value. The default is 0.03, but I like to use 0.01 myself.
    clippingplane.png
     
  30. rozsas_bence

    rozsas_bence

    Joined:
    Mar 10, 2023
    Posts:
    1
    Thank you so so much! It works after six years!
     
  31. Jinxology

    Jinxology

    Joined:
    Jul 13, 2013
    Posts:
    94
    Thank you from July 2023!
     
  32. T1msaa

    T1msaa

    Joined:
    Feb 14, 2023
    Posts:
    1
    thank you so much this was my problem and i have been looking for ages to find a solution
     
  33. Rigidaudio

    Rigidaudio

    Joined:
    Oct 31, 2021
    Posts:
    2
    THANKS!! I was just discovering this and thought it would be a bug or something. Ouuuff* ! :)
     
  34. Epikgamer64

    Epikgamer64

    Joined:
    Sep 17, 2021
    Posts:
    4
    2023 here! I found it works best to double click a small object in your Hierarchy :)
     
  35. TipPrograms

    TipPrograms

    Joined:
    Oct 25, 2022
    Posts:
    3
  36. hardik_47

    hardik_47

    Joined:
    Jul 25, 2023
    Posts:
    1
  37. BeefNBroccoli

    BeefNBroccoli

    Joined:
    Sep 10, 2020
    Posts:
    1
  38. Nguyendung3902

    Nguyendung3902

    Joined:
    Mar 8, 2023
    Posts:
    1
    Thank you, this answer still helping in 10/2023