Skip to content

Conversation

@AswinRajGopal
Copy link
Collaborator

Description

Bug: https://issuetracker.unity3d.com/issues/inputsystems-onscreenstick-behaves-differently-when-using-exactpositionwithdynamicorigin-and-isolated-input-actions-enabled-slash-disabled

With isolated input actions enabled, OnScreenStick only accepted raycast hits on the stick’s root object. In dynamic origin mode the raycast actually hits the child DynamicOriginClickable graphic which leads to the stick to ignore the press and never re-center.

Fix is to treat raycast hits on any child of the stick as valid in isolated mode.

Testing status & QA

Manually verified with the repro steps provided in the case.

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low

Comments to reviewers

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@u-pr
Copy link
Contributor

u-pr bot commented Feb 5, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪

The PR consists of a very small change (one line of logic) using standard Unity API, making it very easy to verify against the problem description.
🏅 Score: 95

The fix correctly addresses the hierarchy issue by using `IsChildOf` to allow interaction with child elements (like the dynamic origin graphic), which aligns with the PR description.
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected
  • Update review

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@u-pr
Copy link
Contributor

u-pr bot commented Feb 5, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent stick activation through blocking UI

Iterating through all raycast results causes the stick to be selectable even when
obscured by other blocking UI elements (like popups or buttons). To respect UI
occlusion and prevent "click-through" behavior, you should only validate the
top-most raycast result.

Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenStick.cs [252-259]

-var stickSelected = false;
-foreach (var result in m_RaycastResults)
-{
-    if (!result.gameObject.transform.IsChildOf(transform)) continue;
+// Check only the top-most element to respect UI occlusion
+        var stickSelected = m_RaycastResults[0].gameObject.transform.IsChildOf(transform);
 
-    stickSelected = true;
-    break;
-}
-
Suggestion importance[1-10]: 8

__

Why: Iterating through all raycast results ignores UI occlusion, allowing the control to be activated through other blocking UI elements (like popups). Verifying only the top-most result ensures that the control respects occlusion, preventing unwanted click-through behavior.

Medium
  • More suggestions

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@codecov-github-com
Copy link

codecov-github-com bot commented Feb 5, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@           Coverage Diff            @@
##           develop    #2341   +/-   ##
========================================
  Coverage    77.95%   77.96%           
========================================
  Files          476      476           
  Lines        97453    97434   -19     
========================================
- Hits         75971    75963    -8     
+ Misses       21482    21471   -11     
Files with missing lines Coverage Δ
...stem/InputSystem/Plugins/OnScreen/OnScreenStick.cs 73.14% <ø> (-0.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant