From 01cf2891c0cec5a775a0b100ad4af8645de17dd7 Mon Sep 17 00:00:00 2001 From: Aswin Gopal Date: Thu, 5 Feb 2026 17:21:38 +0530 Subject: [PATCH 1/3] Fix: Allow isolated input raycast selection to accept hits on child objects. --- .../InputSystem/Plugins/OnScreen/OnScreenStick.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenStick.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenStick.cs index 25920c27c2..7767c76b5c 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenStick.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenStick.cs @@ -252,7 +252,7 @@ private void OnPointerDown(InputAction.CallbackContext ctx) var stickSelected = false; foreach (var result in m_RaycastResults) { - if (result.gameObject != gameObject) continue; + if (!result.gameObject.transform.IsChildOf(transform)) continue; stickSelected = true; break; From e9ee314a6e29aebfe50c5a6c11776361e243041f Mon Sep 17 00:00:00 2001 From: Aswin Gopal Date: Thu, 5 Feb 2026 17:28:14 +0530 Subject: [PATCH 2/3] Update changelog. --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index fb7dbba1bb..28fe13d605 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -21,6 +21,7 @@ however, it has to be formatted properly to pass verification tests. - Align title font size with toolbar style in `Input Action` window. - Updated Action Properties headers to use colors consistent with GameObject component headers. - Fixed misaligned Virtual Cursor when changing resolution [ISXB-1119](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1119) +- Fixed OnScreenStick ignoring dynamic-origin presses when isolated input actions were enabled. [ISXB-1027](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1027) ### Added From 4dd54a4b4de0e6b0de578f238a413685b4f9601a Mon Sep 17 00:00:00 2001 From: Aswin Gopal Date: Tue, 17 Feb 2026 18:00:08 +0530 Subject: [PATCH 3/3] Added test to cover the fix. --- .../InputSystem/Plugins/OnScreenTests.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs b/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs index c25675a958..43a53315f3 100644 --- a/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs +++ b/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs @@ -582,6 +582,40 @@ public IEnumerator Devices_OnScreenStickDoesNotReceivePointerUpEventsInIsolatedM Assert.That(stick.gameObject.GetComponent().anchoredPosition, Is.Not.EqualTo(stickOriginPosition)); } + [UnityTest] + [Category("Devices")] + public IEnumerator OnScreenStick_IsolateMode_ShouldCastRayToChild() + { + InputSystem.AddDevice(); + + var uiTestScene = new UITestScene(this); + + var stickRect = uiTestScene.AddImage("StickParent"); + var stick = stickRect.gameObject.AddComponent(); + stick.controlPath = "/leftStick"; + stick.useIsolatedInputActions = true; + + var childGO = new GameObject("StickImage", typeof(RectTransform), typeof(Image)); + var childRect = childGO.GetComponent(); + childRect.SetParent(stickRect, worldPositionStays: false); + childRect.anchorMin = Vector2.zero; + childRect.anchorMax = Vector2.one; + childRect.sizeDelta = Vector2.zero; + childGO.GetComponent().raycastTarget = true; + + var stickOriginPosition = stickRect.anchoredPosition; + + // Ensure that the OnScreenStick component has been started. + yield return null; + + yield return uiTestScene.PressAndDrag(childRect, new Vector2(50, 0)); + + // Allow one more frame for queued events to be processed. + yield return null; + + Assert.That(stickRect.anchoredPosition, Is.Not.EqualTo(stickOriginPosition)); + } + // https://fogbugz.unity3d.com/f/cases/1305016/ [Test] [Category("Devices")]