Skip to content

Prevent locked and child nodes of selection groups from being selected in the Game view#113915

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
ydeltastar:game-view-node-lock
Dec 12, 2025
Merged

Prevent locked and child nodes of selection groups from being selected in the Game view#113915
Repiteo merged 1 commit into
godotengine:masterfrom
ydeltastar:game-view-node-lock

Conversation

@ydeltastar
Copy link
Copy Markdown
Contributor

This makes selection in the Game view work like in the 2D/3D view, where regular selection skips locked nodes or selects the parent when it's the child of a selection group. Also, like in the main views, these nodes are still included when in list mode with a suffix "(Locked)" or "(Grouped)".

@ydeltastar ydeltastar requested a review from a team as a code owner December 11, 2025 23:45
@akien-mga akien-mga requested a review from YeldhamDev December 12, 2025 08:57
@AThousandShips AThousandShips added this to the 4.6 milestone Dec 12, 2025
@YeldhamDev
Copy link
Copy Markdown
Member

This should be an option, not hardcoded behavior.

@AThousandShips
Copy link
Copy Markdown
Member

Is it optional in the editor? If not it should be in both or neither I'd say

@YeldhamDev
Copy link
Copy Markdown
Member

@AThousandShips Selection needs work differently from editor to debugging. Wanting to select specific components that would probably be locked/grouped in-editor comes much more often, and having to always use the list mode to select them would create unnecessary attrition.

@ydeltastar ydeltastar requested a review from a team December 12, 2025 17:23
@ydeltastar
Copy link
Copy Markdown
Contributor Author

Wanting to select specific components that would probably be locked/grouped in-editor comes much more often

Not my experience. If I'm using locking or selection groups, it's because these nodes are really in the way of what I want to pick.

I added the options.

@Repiteo Repiteo merged commit 08e6cd1 into godotengine:master Dec 12, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Dec 12, 2025

Thanks!

if (Object::cast_to<CanvasItem>(final_node)) {
CanvasItem *ci_tmp = Object::cast_to<CanvasItem>(final_node);
order = ci_tmp->get_effective_z_index() + ci_tmp->get_canvas_layer();
} else if (Object::cast_to<Node3D>(final_node)) {
Copy link
Copy Markdown
Member

@AThousandShips AThousandShips Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke 3D disabled builds, needs to be in #ifndef _3D_DISABLED checks, will make a fix tomorrow if someone hasn't gotten to it before then

Edit: Will write a fix now, pushing momentarily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Locked nodes are selectable in the Game view

5 participants