Working with very tiny objects / Reducing editor camera fly speed

Hi, when I started my game, I accidentally made everything very small. Everything has been fine, 3d audio was a pain for a second. There are a few things making my workflow harder because of this however:

  1. The editor camera’s fly speed is incredibly fast. Even after double clicking items to bring the camera down to scale, the camera speed still doesnt allow me to get the precise postitioning I need. Is there a way to change this or change the

  2. Object’s like particle systems and sounds have an annoying image representing them in 3d space. The problem is these representations are huge images and cover up my objects. Is there a way to turn these overlay items off, or better yet, reduce their size by like 100x?

Great thank you,
Jack

Well first you can disable or adjust the size of the 3D Icons over the Gizmos menu of the SceneView:

97884-sceneviewiconsize.png

However there’s no “proper” solution to your speed problem as the speed is unfortunately hardcoded in the SceneView controls. Feel free to vote for a configurable flyspeed over here.

However I’ve just come up with a neat workaround by blocking the default WASD behaviour and implementing my own. Just copy this script into an editor folder inside your project:

//SceneViewCamSpeed.cs
using UnityEngine;
using UnityEditor;

namespace B83.UnityEditor
{
    public class SceneViewCamSpeed : EditorWindow
    {
        [MenuItem("Tools/SceneViewCamSpeed")]
        private static void Init()
        {
            GetWindow<SceneViewCamSpeed>();
        }
        private static TimeHelper m_Time;
        public float m_Speed = 1f;
        public float m_SpeedMult = 1f;
        public float m_CurrentSpeed = 1f;
        public Vector3 m_Motion;
        public bool m_EnableCustomControl = true;
        public bool m_AutoIncrease = true;
        public bool m_ShowSceneViewGUI = false;
        public bool m_FPSActive = false;

        private void OnEnable()
        {
            m_SpeedMult = EditorPrefs.GetFloat("B83.svcs_speed", m_SpeedMult);
            m_EnableCustomControl = EditorPrefs.GetBool("B83.svcs_enabled", m_EnableCustomControl);
            m_AutoIncrease = EditorPrefs.GetBool("B83.svcs_autoInc", m_AutoIncrease);
            m_ShowSceneViewGUI = EditorPrefs.GetBool("B83.svcs_showSceneGUI", m_ShowSceneViewGUI);

            m_Speed = Mathf.Log(m_SpeedMult);
            minSize = new Vector2(220, 20);
            titleContent = new GUIContent("SV_CamSpeed");
            SceneView.onSceneGUIDelegate += OnSceneGUI;
        }
        private void OnDisable()
        {
            SceneView.onSceneGUIDelegate -= OnSceneGUI;
        }
        private void DrawSpeedGUI(bool aSceneView)
        {
            if (aSceneView)
                GUI.skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Scene);
            else
                GUI.skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector);
            GUILayout.BeginHorizontal();
            GUILayout.BeginHorizontal(/*"box"*/);
            GUILayout.Label("Speed:", GUILayout.Width(50));
            GUI.changed = false;
            m_SpeedMult = EditorGUILayout.FloatField(m_SpeedMult, GUILayout.Width(50));
            if (GUI.changed)
            {
                m_Speed = Mathf.Log(m_SpeedMult);
                EditorPrefs.SetFloat("B83.svcs_speed", m_SpeedMult);
            }
            GUI.changed = false;
            m_Speed = GUILayout.HorizontalSlider(m_Speed, -8, 8);
            if (GUI.changed)
            {
                m_SpeedMult = Mathf.Exp(m_Speed);
                EditorPrefs.SetFloat("B83.svcs_speed", m_SpeedMult);
            }
            GUILayout.EndHorizontal();
            if (aSceneView)
                GUILayout.Space(100);
            GUILayout.EndHorizontal();
        }
        private void OnGUI()
        {
            DrawSpeedGUI(false);
            EditorGUI.BeginChangeCheck();
            m_EnableCustomControl = GUILayout.Toggle(m_EnableCustomControl, "enabled");
            m_AutoIncrease = GUILayout.Toggle(m_AutoIncrease, "auto increase");
            m_ShowSceneViewGUI = GUILayout.Toggle(m_ShowSceneViewGUI, "Show speed slider in SceneView");
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetBool("B83.svcs_enabled", m_EnableCustomControl);
                EditorPrefs.SetBool("B83.svcs_autoInc", m_AutoIncrease);
                EditorPrefs.SetBool("B83.svcs_showSceneGUI", m_ShowSceneViewGUI);
                SceneView.RepaintAll();
            }
        }
        private void OnSceneGUI(SceneView sceneView)
        {
            if (!m_EnableCustomControl)
                return;
            if (m_ShowSceneViewGUI)
            {
                Handles.BeginGUI();
                DrawSpeedGUI(true);
                Handles.EndGUI();
            }
            var e = Event.current;
            if (e.type == EventType.MouseDown && e.button == 1)
                m_FPSActive = true;
            if (e.type == EventType.MouseUp)
                m_FPSActive = false;

            if (e.type == EventType.KeyDown && m_FPSActive)
            {
                switch (e.keyCode)
                {
                    case KeyCode.W:
                        m_Motion.z = 1;
                        e.Use();
                        break;
                    case KeyCode.A:
                        m_Motion.x = -1;
                        e.Use();
                        break;
                    case KeyCode.S:
                        m_Motion.z = -1;
                        e.Use();
                        break;
                    case KeyCode.D:
                        m_Motion.x = 1;
                        e.Use();
                        break;
                    case KeyCode.E:
                        m_Motion.y = 1;
                        e.Use();
                        break;
                    case KeyCode.Q:
                        m_Motion.y = -1;
                        e.Use();
                        break;
                }
            }
            else if (e.type == EventType.KeyUp)
            {
                switch (e.keyCode)
                {
                    case KeyCode.W:
                    case KeyCode.S:
                        m_Motion.z = 0;
                        break;
                    case KeyCode.A:
                    case KeyCode.D:
                        m_Motion.x = 0;
                        break;
                    case KeyCode.E:
                    case KeyCode.Q:
                        m_Motion.y = 0;
                        break;
                }
            }
            else if (e.type == EventType.Layout)
            {
                if (m_Motion == Vector3.zero)
                {
                    m_Time.Begin();
                    m_CurrentSpeed = m_SpeedMult;
                }
                else if (m_FPSActive)
                {
                    float dt = m_Time.Update();
                    var forward = Quaternion.LookRotation(Camera.current.transform.forward);
                    var offset = forward * m_Motion;
                    if(m_AutoIncrease)
                        m_CurrentSpeed *= Mathf.Pow(1.8f, dt);
                    if (e.shift)
                        dt *= 3;
                    sceneView.LookAtDirect(sceneView.pivot + offset * dt * m_CurrentSpeed, sceneView.rotation);
                    sceneView.Repaint();
                }
            }
        }
    }

    internal struct TimeHelper
    {
        public float deltaTime;
        private long lastTime;
        public void Begin()
        {
            lastTime = System.DateTime.Now.Ticks;
        }
        public float Update()
        {
            deltaTime = (float)(System.DateTime.Now.Ticks - this.lastTime) / 1E+07f;
            lastTime = System.DateTime.Now.Ticks;
            return this.deltaTime;
        }
    }
}

You can open this tool window from the main menu “Tools–>SceneViewCamSpeed”. While the window is open and “enabled” it will override the default WASD controls in the SceneView. You can control the speed in a wide range. The settings will be stored in the editor config. The window can be docked anywhere. You can enable the slider control so it shows up at the top of the SceneView.