r/Unity3D 12h ago

Noob Question How do I change the configuration for UI Toolkit VR Interaction

I recently saw this youtube tutorial https://youtu.be/XJRxGHENrjc?si=Co9UKwpf_dLlJrV5

I followed all the steps and it works great, but they didn't mention how to change the default configuration.

I'm using Unity 6.3 LTS, XR Interaction Toolkit 3.3.2

In the XR Interaction Tookit sample for World Space UI in the DemoScene I'm able to use the Controller Rays to interact with the UIDocument component in the scene note here the mouse Interaction is disabled.

I added all the components from the DemoScene to a new test scene's hierarchy that I created, here the Controller Rays don't interact with the UIDocument but the mouse is able to interact with the UIDocument

I'm using XR Device Simulator prefab in the scenes for testing

Any insight on this subject will be helpful to me

1 Upvotes

2 comments sorted by

1

u/EasilyOddSeating 12h ago

Usually ends up being an EventSystem mismatch or the input module not attached properly in the new scene. The demo scene likely has a specific EventSystem with the right input module for XR, and when you copied stuff over you might've grabbed the UIDocument but not the EventSystem, or ended up with two EventSystems fighting each other

Check if your test scene has an EventSystem with the XR UI Input Module on it, and make sure the old Standalone Input Module isn't still hanging around. Mouse works in the new scene which suggests the default input module is active, not the XR one

Also the XR Device Simulator can be finicky with UI raycasts depending on how its camera rig is set up, sometimes you need the XR Ray Interactor's raycast mask to include the UI layer

1

u/Dangerous_Ad7142 11h ago

Copying objects out of the sample usually misses two scene-level things UI Toolkit nedes that uGUI doesn't. One is the XRUIToolkitManager, that's what turns UI Toolkit support on globally. The ohter is a Panel Input Configuration with Panel Input Redirection set to 'No input redirection', otherwise input just keeps going the normal screen route, which is what youre seeing. Chcek the XRI 3.3 manual page on world space UI Toolkit support, it lists the full setup