How to invert the Y axis mouse in the editor?

I haven’t find any way to do this from the [edit → preferences…] menu.
And i can’t believe such a basic option is not available in a modern 3D dev tool.
So I think I missed something; any help is welcome. :slight_smile:

note:
I’am talking here about the editor, not the game options because I know how to do this for applications via project settings → input

Thanks

Just create a new c# script in your Assets with this code:

using UnityEngine;
using UnityEditor;

[InitializeOnLoad]        
public class SceneViewInvCamY : EditorWindow
{
  static SceneViewInvCamY(){
    SceneView.duringSceneGui += OnSceneGUI;
  }

  private static void OnSceneGUI(SceneView sceneView)
  {
    Event.current.delta=new Vector2(Event.current.delta.x, -Event.current.delta.y);
  }
}

I’ve once written an editor window which allows you to replace the default FPS movement code of the sceneview in order to modify the movement speed. I’ve just added custom rotation code as well. Here’s a newer version of that script on my dropbox(download). It allows to invert the Y axis rotation direction for the FPS cam mode (right mouse button). Since i only implemented the FPS mode i did not care about the orbit mode (ALT + left mouse button).

There’s currently no official support for this feature. There’s a similar feedback request
, but not exact match yet. So maybe it’s worth creating one. Sounds like a trivial change, so maybe Unity puts it in even if only a few users want it. Other than that it sounds like a nice editor modification. We can access the SceneView camera and have all the input events, so we can replicate the default camera behavior and invert it ourselves, maybe it’s even possible to modify the existing implementation via reflection.

Thank you for your anwsers. :slight_smile:

It’'s too bad that this feature is missing in Unity because I can’t easily erase 3 decades of automatism using an Y axis inverted mouse in 3D games / 3D applications.

It seems to be a trivial problem, but it really slows down the workflow in a huge way.

I’am trying both Unity and UE4 and haven’t made my choice yet as both are great dev tools…
So wait and see for the next update.

Cheers

//

Edit :
Bunny83 Thank you!

I just used your code and it works perfectly.

It’s a must have for everybody who encounters the same problem.

Thanks again. Cheers.

There is an option to Invert Axis in Edit >Project Settings> Input. In Inspector window there are several axes, every single one should have checkbox with title Invert.
Don’t know since what version this function exist. I’m currently running 2018.2.0f2
,There is option to Invert Axis in Edit >Project Settings> Input. In Inspector windows there are several axes, every single one should have checkbox with title Invert.
Don’t know since what version this function exist. I’m currently running 2018.2.0f2

Hey guys… Anyone looking for an answer for this in the future, I have modified nacmac’s code to ONLY invert when holding right mouse button to look around in the editor. It does not invert mousewheel scroll or when you grab transform handles. I hope this helps(I know I am dropping this bad boy into every project I have):

using UnityEngine;
using UnityEditor;

[InitializeOnLoad]
public class SceneViewInvCamY : EditorWindow
{
    static SceneViewInvCamY()
    {
        SceneView.duringSceneGui += OnSceneGUI;
    }

    private static void OnSceneGUI(SceneView sceneView)
    {
        if (Event.current.type == EventType.MouseDrag && !sceneView.in2DMode && Event.current.button == 1)
            Event.current.delta = new Vector2(Event.current.delta.x, -Event.current.delta.y);
    }
}

(Edit: In 2D mode messing with prefabs it would invert the dragging mode of moving around the scene which doesn’t feel right to me so I added the !sceneView.in2DMode part.)