godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
87.25k stars 19.61k forks source link

Can't select nodes behind a locked node in editor #84764

Open nanodeath opened 8 months ago

nanodeath commented 8 months ago

Godot version

v4.1.3.stable.mono.official [f06b6836a]

System information

Godot v4.1.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti with Max-Q Design (NVIDIA; 31.0.15.3640) - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 Threads)

Issue description

When I lock a node in the editor, I expect to be able to click and select things behind it. Instead, clicks are ignored.

I have a game where your typical view (as the player and when editing using Godot) is an isometric camera and the player is inside a building. There's a ceiling, represented by a plane, with the "front" of the ceiling mesh is pointed down towards the player, leaving the backface to be culled/invisible. The player is able to carry a camera that renders into a viewport in the UI, but this handheld camera (and Camera3D) render from the first person perspective -- that is, below the ceiling, which is why it's there in the first place. That is, the ceiling should be invisible to the bird's eye camera, but not to the first-person camera.

Basically in the editor there's this giant invisible plane covering the entire visible map that, even when locked, blocks my attempts to select anything else in the scene. My workaround is to hide the plane and wire the ready event to the show() method as a one-shot, but this is crude.

Steps to reproduce

  1. Create any two meshes, with one mesh interposed between the other and the editor camera. In my case, one of the meshes is a large plane that sits between the rest of the scene and the editor camera.
  2. Mark the mesh closer to the camera as Locked.
  3. Try to click the further mesh.

In the repro project attached, notice that it's quite hard to actually select the "Player" node.

Minimal reproduction project

LockBlockRepro.zip -- does not require the C# build.

kleonc commented 8 months ago

Confirmed, same in v4.2.beta5.official [4c96e9676].

Note that as a workaround you can drag/box select, or Alt + right click to choose object to select from the menu: wtfLd3tpmf

For comparison in 2D just clicking works fine: lFlDsTagrn

Cammymoop commented 5 months ago

https://github.com/godotengine/godot-proposals/issues/8988 is an alternative way to deal with this.