Viewport Walker + Only Renderer

Viewport Walker

Viewport Walker allows you to use walker mode to navigate the scene view. Walker mode and Flythrough mode are similar, but different.

Flythrough mode let you fly around in first-person view, but Walker mode let you walk around. A virtual gravity pull you to the floor, and you walk on floor even you looking up.

Viewport Walker also provide a virtual sky level and let you jump to it, overlooking the scene. You can also enable or disable walk through walls in Walker mode.

Only Renderer

Only Renderer allows you to disable all gizmo overlay in scene view with one action (Click on toolbar item or use hotkey), instead of click on gizmo menu to disable one by one. It also restore the gizmo setting when you toggle off.

Give you very fast to preview your level without gizmo overlay, then turn gizmo overlay on again to design your level.

Following options is configurable to disable:
Grid, Selection Outline, Selection Wire, Gizmo, Gizmo Icon, Transform Gizmo

You can also save current gizmo and icon settings to presets, and use it with hotkey.

Asset Store

So this is like the Unity Editorā€™s built in scene view navigation?
Flythrough mode
Use Flythrough mode to navigate the Scene View by flying around in first-person, similar to how you would navigate in many games.

  • Click and hold the right mouse button.
  • Move the view around using the mouse, the WASD keys to move left/right/forward/backward, and the Q and E keys to move up and down.
  • Hold down Shift to move faster.

How does it differ?

I ask because the problem I always have with the built-in flythrough mode is that the cameraā€™sclipping plane always goes awry after also zooming in and out of the scene (using the mouse wheel) Does this asset stop this problem happening?

When you use flythrough mode, W key move toward camera view angle. With Viewport Walker, it always move in world space XZ axis, and it always fall to the ground if a collider detect in Y- vector. That make you feel like walking in the scene.

I donā€™t understand it.

Does this work while the game is in play mode? If you have the game tab open and the scene view tab open while the game is running, can you click on the scene view tab and navigate around while the game is still playing?

This: https://answers.unity.com/questions/124283/editors-camera-clipping-plane.html

Yes, it is no problem while in play mode.

The clipping plane is adjusted automatically by editor, Viewport Walker is same as flythrough mode.

Ok, thanks. Sadly it is, and itā€™s not. Itā€™s one of those annoying glitches. Pressing F to focus kinda works but isnā€™t always ideal. Thanks anyway.

I checked the source code of scene view. The near and far clipping plane is adjusted using the distance of camera to the pivot. When you press F to focus a object, the camera pivot is set to the position of the object, the distance is set to the object bound. Zoom in/out with wheel change the distance.

The near value is using a fixed scale to the far value, so focus to a large object cause a high value of both far and near clipping. Using low near value and high far value make the depth buffer resolution low, that is why unity adjusted the clipping automatically.

I can write a small script to adjust the distance to the pivot, then the clipping can be adjusted. However, there are some limitations:
The pivot position change because the distance change and camera position unchanged.
The near and far clipping is increased or decreased together.
The distance is changed again when you use wheel to zoom.

Thatā€™s kind of you to look into that. If you could add that script in an update that would be brilliant. I totally understand the limitations, but it would make the asset totally worthwhile for me.

To be honest, at such a reasonable price itā€™s worth my while just supporting you by buying it, so thatā€™s now done :slight_smile:

1 Like

3526600--282370--2018-06-09 18-13-01.gif

Here is the script, put it on editor folder. Hold P key and scroll wheel to adjust the clipping, with Shift key to adjust faster. Hold P key and right click to directly set to a default value.

You can change the const to change hotkey or default value. Enjoy!

using UnityEditor;
using UnityEngine;

[InitializeOnLoad]
public class ClippingAdjustment
{
    private const KeyCode kHotkey = KeyCode.P;
    private const float kDefaultSize = 10f;
    private const float kNornalMultiplier = 1f;
    private const float kShiftMultiplier = 10f;

    private static readonly int kControlIDHint = "ClippingAdjustment".GetHashCode();

    static ClippingAdjustment()
    {
        SceneView.onSceneGUIDelegate += SceneGUIDelegate;
    }

    private static void SceneGUIDelegate(SceneView sceneView)
    {
        int id = GUIUtility.GetControlID(kControlIDHint, FocusType.Keyboard);
        var current = Event.current;
        var type = current.GetTypeForControl(id);
        switch (type)
        {
            case EventType.KeyDown:
                if (current.keyCode == kHotkey)
                {
                    GUIUtility.hotControl = id;
                    current.Use();
                }
                break;
            case EventType.KeyUp:
                if (GUIUtility.hotControl == id && current.keyCode == kHotkey)
                {
                    GUIUtility.hotControl = 0;
                    current.Use();
                }
                break;
            case EventType.MouseDown:
                if (GUIUtility.hotControl == id && current.button == 1)
                {
                    SetSceneViewSize(sceneView, kDefaultSize);
                    current.Use();
                }
                break;
            case EventType.ScrollWheel:
                if (GUIUtility.hotControl == id)
                {
                    float size = sceneView.size - current.delta.y * (current.shift ? kShiftMultiplier : kNornalMultiplier);
                    SetSceneViewSize(sceneView, size);
                    current.Use();
                }
                break;
        }
    }

    private static void SetSceneViewSize(SceneView sceneView, float size)
    {
        var distance = sceneView.size / Mathf.Tan(90 * 0.5f * Mathf.Deg2Rad);
        var pos = sceneView.pivot - sceneView.rotation * Vector3.forward * distance;
        sceneView.size = Mathf.Max(1, size);
        distance = size / Mathf.Tan(90 * 0.5f * Mathf.Deg2Rad);
        sceneView.pivot = pos + sceneView.rotation * Vector3.forward * distance;
    }
}

I just purchased this and it doesnā€™t work. When I double click in the scene view, nothing happens. Iā€™m using 2017.4.3f1 and there are no errors but it doesnā€™t do anything.

ummmā€¦ yes, finally tried it today and not working for me either in 2017.2.0

Double right clicking doesnā€™t do anything.

The script you kindly posted (for the camera clipping) also doesnā€™t do what it does in your gif. It moves the caemra but not the clipping plane.

Not sure if thereā€™s something stupid weā€™re doing or if thereā€™s a problem when used with 2017.x? I noticed you uploaded with Unity 5.6.0

Is the mouse cursor changed to FPS mode after double click with right button in scene view?

I have tested the script in 2017, do you keep P key hold down while scroll the wheel?

I make the interface more simple with 3 key: P set to 10, I decrease 10, O increase 10.
Replace the switch statement with following code:

        switch (current.type)
        {
            case EventType.KeyDown:
                if (current.keyCode == KeyCode.P)
                {
                    SetSceneViewSize(sceneView, 10);
                    current.Use();
                }
                if (current.keyCode == KeyCode.I)
                {
                    float size = sceneView.size - 10;
                    SetSceneViewSize(sceneView, size);
                    current.Use();
                }
                if (current.keyCode == KeyCode.O)
                {
                    float size = sceneView.size + 10;
                    SetSceneViewSize(sceneView, size);
                    current.Use();
                }
                break;
        }

Iā€™ve just tested on a different PC, in 2017.2.1 and it kind of works as expected, I think. The mouse cursor changes to fly-through mode and stays there. On the other PC, double right-click makes the fly-through cursor appear but only just briefly (i.e. when you click down, as you would expect) but the double click doesnā€™t make it stick.

WASD work fine but Iā€™m not finding that ā€˜Eā€™ takes me up to sky level, and ā€˜Qā€™ doesnā€™t drop you down as your video does.
[EDIT] now I know why - ā€˜Qā€™ doesnā€™t work unless thereā€™s a collider below you (youā€™re obviously raycasting down to check otherwise youā€™d keep on falling :slight_smile: ) This makes sense but you might want to mention it in the docs, and ideally also in the interface (a brief pop-up in scene view?).

A couple of requests (as the asset is a DLL itā€™s not user customisable)
Can there be a settings inspector which allows:

  1. change the ā€˜walkā€™ speed and ā€˜runā€™ multiplier. (even better include a keyboard shortcut for this - maybe mouse wheel while moving, i.e. while holding down W, A, S or D, moving the mouse wheel changes the speed).
  2. an option to switch mouse look to the right mouse button, not left (as is the default)

Let me know if I can do anything to help debug the ā€˜not workingā€™ instances of the asset (on my other PC). Iā€™ll try it on an empty Project when I get home tonight. I had tried it in an existing project and I guess there may be a conflict with another asset?

This is full of potential, and is a definite improvement on the normal Unity fly-through (especially if you can add the speed customisations I mentioned)

Scroll the wheel adjust the sky level, if the level is lower than your position, press E will no response. I will make a notification if E and Q cannot perform for some reason.

I will make a config window in next version.

I dunno if the problem from the detection of double right click, but I just use info provided by unity. Please copy this script to a editor folder, then double right click to seen if a log ā€œDouble Right Click!ā€ added to console.

using UnityEditor;
using UnityEngine;

[InitializeOnLoad]
public class DoubleRightClick
{
    static DoubleRightClick()
    {
        SceneView.onSceneGUIDelegate += SceneGUIDelegate;
    }

    private static void SceneGUIDelegate(SceneView sceneView)
    {
        var current = Event.current;
        if (current.type == EventType.MouseDown && current.button == 1 && current.clickCount == 2)
            Debug.Log("Double Right Click!");
    }
}

So adding to a clean project works fine. 2017.2.x and 2017.4.x

Iā€™ve taken the problematic project and deleted everything from it and it still has the bug.

  • double click is detected (using your script I get the console debug message appear) but the fly-through mode doesnā€™t ā€˜stickā€™.

Restarting Unity (with what is essentially an empty project) still has the bug.

However, deleting the Library folder and then restarting makes it work ok. Sadly itā€™s not really something that most people will want to do on an existing project, just for a small utility.

Iā€™ll email you the buggy project. Hopefully you can find a way of fixing the problem without forcing people to delete the Library folder.

Thanks, I will look into it.

I find the problem, the scene camera is orthographic in your project. As FPS mode is no meaning in orthographic mode, so it cannot be activated. I will add a notification that it cannot activate in orthographic mode.