From e1ffdee57a0bf8ca6186bd247da0fbb140c0cd4a Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 30 Jan 2026 15:51:53 -0600 Subject: [PATCH] If UI is culling children, dont return children outside of client area for raycast. --- Source/Engine/UI/GUI/ContainerControl.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Engine/UI/GUI/ContainerControl.cs b/Source/Engine/UI/GUI/ContainerControl.cs index ada93ff1e..55fcecf80 100644 --- a/Source/Engine/UI/GUI/ContainerControl.cs +++ b/Source/Engine/UI/GUI/ContainerControl.cs @@ -901,6 +901,15 @@ namespace FlaxEngine.GUI internal bool RayCastChildren(ref Float2 location, out Control hit) { + if (_clipChildren) + { + GetDesireClientArea(out var clientArea); + if (!clientArea.Contains(ref location)) + { + hit = null; + return false; + } + } for (int i = _children.Count - 1; i >= 0 && _children.Count > 0; i--) { var child = _children[i];