Steps to reproduce:
- Open Unity Hub
- Download and create a VR or AR Mobile template project
- Enter Play Mode
- Focus on the Game view and move the mouse
- Observe the Console
Actual results: NullReferenceException is thrown on any mouse movement while the Game view is focused
Expected results: No errors are thrown
Reproducible with versions: 6000.5.0b3, 6000.5.0b6
Not reproducible with versions: 6000.0.73f1, 6000.3.14f1, 6000.4.4f1, 6000.5.0a9 (253a859729df)
Could not test versions: 6000.5.0a9-6000.5.0b2 (package errors upon creating the project which required XR Interactions package to be updated), 6000.6.0a3 (No non-SRP templates available in the Hub)
Tested on (OS): macOS Sequoia 15.7.4 (intel), Windows 11 Pro (25H2)
Notes:
- Part of the error reads:
"NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UIElements.CameraScreenRaycaster.MakeRay"
- Doesn't reproduce with XR Interaction Toolkit versions 3.4.0 and 3.5.0 (by default the VR and AR Mobile templates should be using versions 3.4.1, and 3.3.0 respectively)
- In version 6000.5.0a9, the AR Mobile template is using version 3.4.0 of the package, which does not reproduce the issue (though after creating the template I had to resolve some URP package errors (not related to the bug)
- In version 6000.5.0b3, the AR Mobile template is using version 3.5.0-pre.2 of the package which also reproduces the issue
- The AR Mobile template was used to search for the regression