In the editor, can I have click & drag selection rectangle pick any object that touches it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kitfox

I’m new to Godot and used to other editors where clicking and dragging a selection rectangle will select anything that touches the selection rectangle region. However, Godot seems to only select objects that are entirely within your selection rectangle. Is there a way to change this behavior?

There’s no setting for this in the editor settings. In fact, I’ve had highlighting and selecting objects via the 3D scene just outright stop working sometimes but I still can’t pinpoint what causes it.

Magso | 2020-02-25 18:26

:bust_in_silhouette: Reply From: Zylann

This is how the selection tool works in Godot. I’m not aware of a setting to change it, or if it’s even a feature.

To change this, the engine has to be modified, using intersection instead of contains.
Here is where the selection box is confirmed: https://github.com/godotengine/godot/blob/2ead439370ab220043df3fe1effc239ee597c1cd/editor/plugins/canvas_item_editor_plugin.cpp#L2352
And here where the test is actually performed: https://github.com/godotengine/godot/blob/2ead439370ab220043df3fe1effc239ee597c1cd/editor/plugins/canvas_item_editor_plugin.cpp#L767

I had a look at the source code. It seems that only bounding boxes are considered in for the selection. I might be able to write something to allow a tighter fit for mesh objects. Is this something the dev team would be interested in?

kitfox | 2020-02-27 00:49

You can write an issue in the proposals repo, or ask on IRC

Zylann | 2020-02-27 19:21