In order to connect to the same room, please open the same url on both devices. The URL contains the room parameter which is how the two devices will end up in the same sessions.
Thanks @kipash ! I have loaded the collaborative-sandbox sample as you suggested. As first learning task I would like to modify the Oculus controller behaviour when turning around. Right now it works at “steps”, I would like to make it continuous. I see there are an XR object with an WebXR.ts script attached and a XRRig object with XRRig.ts script attached. Should I modify one of these scripts? Any guidance?
Fundamentally, you need to reference the WebXR component and there get the controlls from there. On the controller you need to disable the default controls by setting the enableDefaultControls to false.
Then in the input object, you can find the gamepad. From that you can fetch the Joystick axes values.
Thank you for the great info! I see that I have to create a typescript file exporting a class deriving from Behaviour right? Also the file name must match the class name, otherwise I get an error. Once the typescript file is saved, there is a c# file automatically created in Assets/Needle/Components.codegen. Can you elaborate a bit why this file is needed?
C# files are generated from your typescript files so you can add the component on to a Gameobject.
These C# auto generated files only contain public variables and functions so you can set the variables in inspector or call functions from unity events (like on UI button).
Then that data is set to the typescript instance allowing a seamless workflow between unity and the web.
The auto generated files do not contain any contents of the functions, in other words, they don’t contain any logic. Only a data oriented stub is generated to allow interconnectivity.
These auto generated C# classes are partial, so you can always extend the class. That is helpful if you for example want to use needle only for the web and still use unity for native platforms.
This way you can write the component both in C# and Typescript and then export to any platform as you need.
Just to make sure, no C# class is converted into Typescript and No typescript class is converted into C#, only the variable and function declaration are extracted, not their logic.
Thanks a lot guys! I was trying to access the WebXR object in the start() hook to get the controllers, but it seems the array is empty. I guess is because the ENTER VR button is not clicked yet? In this case, I would need an hook for when entering the VR session to get the controllers, but looking here Needle Engine Scripting | Needle Engine Documentation I don’t see a lifecycle method for this. How would you procede?