Mouse input in scene view doesn't work

I have an issue where I can no longer rotate the camera in the scene view with right click or click any objects.

The orientation lock is off, it’s not on 2D mode, I’ve looked at all my editor scripts and found nothing strange (even went through all of them and disabled them one by one to check).

Scrolling works to zoom, selecting things in the hierarchy and hitting f to focus works, but clicking anywhere in the scene view doesn’t work, except on the transform gizmos.

I tried disabling a bunch of packages, disabling the input system, fiddled around with settings for hours. I’m at a loss.

If I make a new project, the issue is gone. I can’t migrate this project to a new one as it’s far too big for that. I use git for version control, but rolling back a couple of commits it still doesn’t work. To be fair, I don’t know when this started occurring exactly but I don’t want to roll back weeks because of what seems like a scene view bug.

I tried making a custom editor script that mimicks the rotation and right clicking.It detects the right click, but nothing happens with the scene view camera.

I’m at a loss here. Anybody got any ideas?

Yes.

  • You will need to go back until you find what have you changed to start this behavior. You can only fix the thing if you know what is the thing. And since we don’t know nothing about your project, we can’t even guess.
  • Scene View bug? How do you know? You don’t know what causes it. It may be, may be not. Maybe a bad package you introduced causing it, maybe something you have done triggered a bug in Unity. We don’t know until you debug and find out what caused the appearance of this problem.

You don’t have to stay on the code from weeks before, you just need to investigate and find out the cause, then you can come back to your latest and apply changes to avoid the problem. And/or submit a proper bug report.

Thanks. You’re right, of course. So, I rolled back months until I passed a point where I was 100% it wasn’t an issue before. Unfortunately, the problem persisted. Apparently my gitignore (standard unity template) didn’t cover it, so that narrows it down to a plugin, package, lib, or a bug.

Curious thing: I can still move the scene view camera with the arrow keys. I just can’t right click to rotate (it doesn’t show the eye icon with rotation either) or click anything in the scene but a gizmo. An editor script polling the mouse does register mouse1 as clicked, but the scene view doesn’t process it.

Updated to 2022.3.20f, tried a bunch of other installs too. No dice.

I went as far as deleting every single editor script, resolve all compilation errors and restart. Nothing. Is there a way to diagnose/debug sceneview events?

I noticed you didn’t call out doing a reimport-all… that’s always a thing to try.

You can also try nuke the ProjectSettings/ folder and replace it with a blank vanill one from a new project, see if it fixes it, then revert it with git if it didn’t.

Thanks. I did a reimport. Nuking projectsettings and replacing it with the one from a fresh project seemed like a good idea. Didn’t work.

I updated to 2023 out of desparation and now when I right click in the scene view, I get a context menu like so:9669674--1377494--upload_2024-2-28_14-27-31.png

When I hover over the menu items I can see them highlighted, but clicking on any of the menu items does nothing.

So, something in my project is keeping something nonexistent in the scene view actively selected for some reason. I can’t see what that might be in the inspector or the hierarchy.

Today spontaneously I got the same problem, Unity version 2022.3.14f1

1 Like

I have everything working fine in the new project… I can assume that the problem is inside the current project.

I’m migrating everything to a new project. It’s tedious and time consuming but I haven’t found any other solutions.

For anyone dealing with this: I figured it out. This code was the culprit:

EditorApplication.delayCall = () => { EditorApplication.delayCall = () => { FORCE_INIT = false; }; };

Bug introduced in f14 that breaks how this works.

2 Likes

I’m experiencing the same problem… :confused: Where did you find that culprit code line…? Looking through my 3rd party editor scripts, but don’t find anything like that yet

Wow. I’ve been searching for a day to find out what is going on. How on earth did you find the culprit? I never would’ve found that. That’s bonkers.

The problem for me (the exact same line by the way) was in ReorderableArrayInspector, a small library used for allowing reorderable arrays in the inspector.

For the record: I figured out what the problem was. This is a delegate called when all inspectors have been reloaded, and this plugin just overrides all subscribed callbacks in delayCall and sets it to itself. Apparently, a new version of Unity subscribes to this callback and uses it for crucial functionality in the scene view.

So I wouldn’t call this a bug; rather a plugin that was written really badly.

Change it to this line to fix it:

EditorApplication.delayCall += () => { EditorApplication.delayCall += () => { FORCE_INIT = false; }; };

This will still subscribe to the callback but not delete any others subscribed to it.

3 Likes

@Raveler thank you for figuring out what was going on, I ran into this exact problem with this exact library. What a relief to come across your post! The suggested code change has fixed the issue for me.

For me it started happening on 2022.3.17f1 recently. Thanks for this thread as it pointed me to the right direction.
In my instance it was a 3rd party package trying to do this and by commenting these lines… life is good.

UnityEditor.EditorApplication.delayCall -= AutoSwitch;
            UnityEditor.EditorApplication.delayCall += AutoSwitch;
1 Like

When using UXF you can encounter the same issue.

Script path: UXF\Scripts\Etc\ReorderableInspector\Editor\ReorderableArrayInspector

Line 65: EditorApplication.delayCall == () => { EditorApplication.delayCall = () => { FORCE_INIT = false; }; };

Solution: EditorApplication.delayCall += () => { EditorApplication.delayCall = () => { FORCE_INIT = false; }; };

1 Like

Wanted to post this here for reference as it seems to fix an issue with similar symptoms:

I do not have any invalid use of EditorApplication.delayCall in my code or imported 3rd party libs. I am observing a SceneVIew with input not working (except for the scroll wheel).

The solution in this case was to jam on the right mouse button and wiggle the mouse until the scene view becomes responsive again:

I had the same mouse problem, and error pointing wrong path to .png icon file. After hours of reinstalls, reimporting project, etc. I found this happened because I changed Unity editor from dark theme to light. Changing back to dark resolved all. :grinning:

There are probably many reasons that can cause this behavior, but it looks like one common theme is plugins that fail while hooking into the EditorApplication’s initialization (i.e. getting called from UnityEditor.EditorApplication.Internal_CallDelayFunctions).

In my case, this was caused by misbehavior of com.unity.xr.interaction.toolkit@3.0.7. More specifically:

  1. com.unity.xr.core-utils@2.3.0\Editor\ScriptableSettingsInitializer.cs contains setup code in EditorApplication.update += Update;

  2. This ends up calling IsLayerEmpty() in com.unity.xr.interaction.toolkit@3.0.7\Runtime\Interaction\Layers\InteractionLayerSettings.cs

  3. It was throwing an error because the serialized m_LayerNames field was null

I don’t understand why the issue was occurring (probably a bug in the XR Interactions Toolkit) but the bottom line is that to fix the “mouse problem” you need to make the exception/error somehow go away. In my particular case, adding a random comment to InteractionLayerSettings.cs forced Unity to recompile and somehow made the serialization issue go away, and with that, the Editor problem went away too.

1 Like

Top answer - insta fix

i see you guys found a way to fix it but as an absolute noob in unity i cant for the life of me figure out where to change this code. anyone able to explain where i can find the line of code that needs to be changed?