"Interaction" scene and AR simulation
Hi,
I'm trying to find a workflow using AR Foundation and the XR Interaction Toolkit.
If if try the scene "Interaction" on the XR Simulation scene, it's not working : clicking with a mouse on a detected surface doesn't do anything. It's working fine when it's build on Android.
Is this a known limitation or am I doing something wrong ? The scene "SimpleAR" is working fine on the XR Simulation Scene.
Thanks!
Likewise, the XR simulation feels pretty useless for previewing placing a product in situ and interacting with the scene through XR Interaction Toolkit, any fixes or ideas?
I asked the same in the Unity forum last week. no reply yet. Dilmer Valecillos confirms that he couldn't make XRI and AR Simulation work together, too. let's cross fingers that some Unity dev will improve these
Hi folks, apologies for radio silence on this issue.
The XR Interaction Toolkit team has begun working on updates to their AR components to be compatible with XR Simulation. We'll update this thread once they have more to share about that.
The issue is that the XR Interaction Toolkit components currently use the Input System's touchscreen bindings, so you would have to provide touchscreen input to Unity for these components to work in Simulation. In the AR Foundation samples we use Pointer bindings for everything. Pointer resolves to a touch input on mobile and a mouse input on desktop, allowing us to write a common set of code that executes in Simulation as well as iOS and Android platforms.
For anyone writing their own input scripts, you could look at our PressInputBase class for inspiration on how to implement simulation-agnostic input.
Did anyone get it working for the time being?
I hope you'll all find this helpful. I've created a GitHub template repo (which means you can quickly create your own repo from it) that uses AR Foundation and XRI together, with a demo scene using XR Simulation to place and manipulate AR objects.
This short video shows how it works: https://www.loom.com/share/35e79df3781a4b9992e516e6c8cb5a7c
The repo is here and I've tried to make the README pretty clear about how to get started: https://github.com/JasonSpatial/ar-template
I hope this helps.
Thanks @JasonSpatial!
I saw Jason give a talk at the GameDevGuild conference a couple weeks ago where I learned of his workaround. He uses the Input System's TouchSimulation while working with XRI in the Editor (does not support multi-touch input): https://github.com/JasonSpatial/ar-template/blob/main/Assets/_Project/Scripts/Editor/ToolsEditor.cs
In this case he enables and disables touch simulation via a button on a component Inspector. This might be a suitable workaround for some folks in the meantime until XRI supports AR Foundation's XR Simulation.
I hope you'll all find this helpful. I've created a GitHub template repo (which means you can quickly create your own repo from it) that uses AR Foundation and XRI together, with a demo scene using XR Simulation to place and manipulate AR objects.
This short video shows how it works: https://www.loom.com/share/35e79df3781a4b9992e516e6c8cb5a7c
The repo is here and I've tried to make the README pretty clear about how to get started: https://github.com/JasonSpatial/ar-template
I hope this helps.
great! no way it works with 2022.3?
I think it should work with 2022.3. The repo is on 2023 but AR Foundation and XRI are doing all the work so you could whip up a new project pretty quickly.
On Mon, Jun 5, 2023 at 11:01 PM Stefano Cecere @.***> wrote:
I hope you'll all find this helpful. I've created a GitHub template repo (which means you can quickly create your own repo from it) that uses AR Foundation and XRI together, with a demo scene using XR Simulation to place and manipulate AR objects.
This short video shows how it works: https://www.loom.com/share/35e79df3781a4b9992e516e6c8cb5a7c
The repo is here and I've tried to make the README pretty clear about how to get started: https://github.com/JasonSpatial/ar-template
I hope this helps.
great! no way it works with 2022.3?
Hi all, we've learned that XR Interaction Toolkit (XRI) 2.5 will include some mobile AR refactors, one of which is adding support for AR Foundation's XR Simulation. XRI 2.5 is not public yet but I thought followers of this thread would like to know this is coming.
Hi all, we've learned that XR Interaction Toolkit (XRI) 2.5 will include some mobile AR refactors, one of which is adding support for AR Foundation's XR Simulation. XRI 2.5 is not public yet but I thought followers of this thread would like to know this is coming.
Thanks for the information ! Any ETA for XRI 2.5 ?
Thank you big time for this solution Jason, going to give it a try. I was also curious if there was a clear timeline for XRI 2.5? Trying to help my students tinker with AR Foundation, and it would be great to have something to go to as a backup for testing!
Hi all, happy to share that XRI 2.5 is out now! Looks like the docs haven't uploaded yet (this usually takes up to 48 hours after release), but I see 2.5.0 in the public registry, so you should be able to manually request this version in Package Manager.
i see it in the docs https://docs.unity3d.com/Packages/[email protected]/manual/index.html but not in the public registry (still 2.4.3) :)
The Package Manager in the Unity Editor does not show you the public registry-- it shows you a snapshot of the public registry at the time that the Editor was released. If you add the package by name and specify version 2.5.0, you'll see that the package is in fact in the public registry. https://docs.unity3d.com/Manual/upm-ui-quick.html
I updated to 2.5.0, but the mouse clicking is still not detected in the XR simulation against a detected floor, am I doing something wrong ? I'm using the "AR Placement Interactable" component.
It's working fine on the starter scene "ARDemoScene" but this scene doesn't use this component
The Package Manager in the Unity Editor does not show you the public registry-- it shows you a snapshot of the public registry at the time that the Editor was released. If you add the package by name and specify version 2.5.0, you'll see that the package is in fact in the public registry. https://docs.unity3d.com/Manual/upm-ui-quick.html
done modifying the packages manifest file, thank you!
I didn't get the impression that 2.5 would take away the need to simulate touch. In fact, looking at the XR Screen Space Controller, it has input mappings for Touchscreen Gestures, which suggests it's still expecting a simulated touchscreen gesture.
This still works the way it worked before, by enabling Touch Simulation, either via the Input Debugger or via script, as I've done here with a simple editor script for an empty component I've added to AR Session.
I haven't tried this yet myself but it looks like you can set up Editor input by modifying the Touchscreen Gestures Input Action Map as shown on this new page in their docs: https://docs.unity3d.com/Packages/[email protected]/manual/ar-interaction-overview.html
Apologies if this is a Unity forum question as I am more on the art/design end of things. I've tested your amazing project @JasonSpatial but am curious how I would be able to integrate this script into the AR Sample project provided by [Unity] (https://github.com/Unity-Technologies/arfoundation-samples). I would very much love to leverage both the interactable functionality with image tracking but feel like I am running into the same testing roadblocks. I've tried to setup the inputs as mentioned in 2.5 with no luck.
I also neglected to mention I am working on a 2022.3.0f1 version if that would present another complication.
@Creepymulder
ARPlacementInteractable is part of the old way of setting up a scene for AR. Here is a doc page for how to set up AR with the new changes in XRI 2.5.
@profkeegan
Just to be sure, include the Input Action Map provided by the XRI 2.5 Starter Assets referenced by your InputActionManager in the scene. Without it gestures will not be detected. If you want a working example please take a look at the AR Stater Asset's ARDemoScene. You can pull these starter assets by checking out the XRI package from the package manager window.
Also, only one-finger touch gestures are currently supported in simulation mode.