Survey and Discussion - "Right-Click" (contextual) menu in the Scene View

DISCLAIMER This is an early survey only, no actual feature or timeline is implied or guaranteed.

Hi there! We are beginning explorations for a “right-click menu” in the Scene View. Meaning, the fairly standard ability to right-click (or other shortcut) in the Scene View, and see a menu appear with contents matching the context.

The intent here is to gather basic expectations and general feedback, before considering further. If enabled, this would be a major UX change for Unity, and we want to ensure everyone has a chance, early on, to discuss this.

Please take a few minutes to fill out the short survey HERE, and use this thread for discussion. Thank you for your time and input!

2 Likes

All your presenting is to take what we already can do by right clicking the asset (lets say a rock), in the hierarchy and making it easier by just right clicking the object itself in-scene. Im not opposed to this idea, as other progs do this.

I feel im not understanding exactly what your goal is. Does this mean the right click in the hierarchy will be removed, and only accessable from right clicking the object in-scene?. Maybe showing an example would better help people understand what you are presenting.

Hi Warthos :slight_smile: I’m keeping it fairly general on purpose here, to not bias answers. To clarify a bit though - this is adding a new feature, not changing or removing others. The main benefit being to artists, who could now interact with an item directly in their view, vs needing to move over to the hierarchy and find the item there.

Additionally, it opens up exciting new ways to interact with items not shown in the Hierarchy - vertices on meshes, spline points, tiles, etc.

3 Likes

Thanks for clarifying that. I think its a great idea to impliment, and would speed up project time, my personal one is delete, so many times i just want to click and delete (as i do in other progs), and not have to make an additional process to do so.

Moving (not removing) the right clicking menu in the hierarchy, to a right click in-scene would be great, and then elaborating on it would really help. Love the idea, thanks for your effort, appreciated :slight_smile:

1 Like

This thread never got any attention! womp womp.

So in general yes, a thing like a right click menu that’s invokable in the scene view is nice. It can’t be on rmb since that’s already used to rotate the camera and differentiating between click and drag is annoying and bad.

One of the worst things about using Unity today is the difficulty of selecting things in the scene view. Especially in 2D games, you end up with a lot of transparent elements overlapping each other, and selecting the one you want is super annoying. You can end up clicking the same pixel 10+ times to get to the object you want. Prefabs and [SelectionBase] just not cooperating with each other does not help at all.

The obvious solution, to me, is to have a pop-up menu you can bring up under the mouse that shows a hierarchy of all the objects that’s under the mouse. We can do this ourselves (and have, at times!), but that’s based on renderer/collider bounds, which is not as accurate as the algorithm Unity uses to decide what object(s) the mouse is over or not.

A nice way to solve this partially for us (so we can make neat tools for our workflow instead of you having to fumble around to find a general purpose one) is to do two things:

  • Make it easy to open a temporary Overlay under where the mouse is (so we don’t have to fiddle with drawing UI in DuringSceneGUI)
  • Expose the internal function that has to exist somewhere that decides “which objects are under the mouse” that’s used to cycle through objects when we click in the scene view.
2 Likes

Hey Baste! Sorry I’m late to reply!

So, RMB - I’m not sure what the issue is? It’s standard to use LMB click, and LMB drag separately. RMB is the same thing, different button. And RMB is the most common solution for this sort of menu, so it seems the best option. Most importantly though, it’ll be 100% customizable, as all mouse, keys, and modifiers are now :slight_smile:

Selection - 100%, and I’m in the process of designing out how this could work for us, right now. No promises when/if/etc, of course. Taking the same approach you mention - as pretty much ever good DCC does - pop up menu with items at pixel. Further though, I think we desperately need a proper type-filtering solution … also a standard in DCCs (except Unity :P). Eg, you could disable selection of all items with UI components, etc.

4 Likes

Sorry for a not so much related discussion.
We have good experience with the Selection Utility Tool. This help us select overlapped objects In 2D game.

But in 2022 the temporary pan tool implementation changed and make sceneView stuck at the Pan Tool.
SceneView become stuck when show a popup window with right click in SceneView.duringSceneGUI.
Selection Utility set GUIUtility.hotControl to 0 to get rid of the stuck.

2021 implementation

static void UpdateViewToolState(Event evt)
        {
            bool shouldBeActive = false;
            if (GUIUtility.hotControl == 0 || Tools.s_LockedViewTool != ViewTool.None)
            {
                bool viewShortcut = evt.type != EventType.Used && (evt.alt || evt.button == 1 || evt.button == 2);
                shouldBeActive = Tools.s_LockedViewTool != ViewTool.None || Tools.current == Tool.View || viewShortcut;
            }
            if (shouldBeActive != s_ViewToolActive)
            {
                s_ViewToolActive = shouldBeActive;
                viewToolActiveChanged?.Invoke();
            }
        }

2022.2 implementation

static void UpdateViewToolState(Event evt)
        {
            bool shouldBeActive = false;
            if (evt?.type == EventType.MouseDown)
            {
                var eventKeyCombination = new[] { KeyCombination.FromInput(evt) };
                foreach (var shortcut in ViewToolShortcuts)
                    shouldBeActive |= shortcut?.StartsWith(eventKeyCombination) ?? false;
            }

            shouldBeActive |= Tools.s_LockedViewTool != ViewTool.None || Tools.current == Tool.View;
            if (shouldBeActive != s_ViewToolActive)
            {
                s_ViewToolActive = shouldBeActive;
                viewToolActiveChanged?.Invoke();
            }
        }

Any suggestion to fix the problem? We are eager to have a project version change due to Mac M1 crash problem.

1 Like

@gabrielw_unity

So this is why my right click menu got messed up since 2022.2 for Interactor.

Normally if my spawner window is opened, right click in sceneview (within specified double click time as ms) opens a spawner menu which allows users to select prefabs to spawn on clicked position/object.

But since 2022.2, it gets stuck with sceneview camera movement (like EventType.MouseUp is never happened) when menu pops up.

So how can these two coexist when you implement this?

1 Like

Has a solution for this been found? Would really like to add a right click menu to 2022.3, but this issue makes it quite annoying.

Maybe, see here: Custom tool development in 2023 - thoughts on the contextual system? - Unity Engine - Unity Discussions

Hi @gabrielw_unity

Is there a way to disable contexual menu for a while in the api?

Hey @razzraziel ! Sorry for the delay, was on vacation. I think the correct solution, would be to utilize the Shortcut Manager system. That will avoid conflicts, and let your users pick whatever key/combo they like (for yours, and ours).