๐Ÿงต#AR placement

marwi123

Check if you have a WebARSessionRoot component in your scene. It controls where the center of your scene is. If you don't have an object with this component in your scene you can add one to it and place it. Alternatively make sure your content is in the root of the scene (at 0, 0, 0)

firas00904

thank you for the fast answer. I do have webar session root set. It does not have any fields in the inpector right?

marwi123

No, you just position it in your scene. Maybe first try to remove it and see if automatic placement is already working as expected. If not then add the WebARSessionRoot and move the object to e.g. the (bottom) center of your models.

marwi123

Both works altough I always modify AR scale in the WebXR component. In the next update will be improved previz in Unity for the AR placement/reticle.

Maybe you can also check if removing the SessionRoot and enabling AutoCenter is already giving you good results? It's using the bounds of the objects in your scene to calculate the AR placement center

firas00904

but i did reduce all object sizes in the scene to make it smaller as AR scale is not doing anything noticeable, yet again, i might be doing something wrong

marwi123

It might be because scale is inverted:

  • Large AR scale makes the scene appear small
  • Small AR scale value makes the scene appear big

The reason for this is that internally we scale your XR rig/camera. This is so that when you use any networking features your AR representation is rendered at the correct position/rotation/scale.

marwi123

Most of the time you want to build your scene in 1:1 scale (where 1 unit is approx. 1 meter). Because then all the PBR rendering materials work correctly and you're not actually rendering a minitiature object (which is scaled up or down).

marwi123

You need to update, we released this version a few minutes ago. You can update via the Needle Engine component (at the bottom) or via "Window/PackageManager/Needle Engine"

marwi123

The footer of the Needle Engine component shows which version you're currently using. 4.11.3 is the latest version.

firas00904

is there a way to link the AR scale to the actual scene? Since i just made everything scale 1, and reduced the ar scale below 1 and even tried scale 5, still no changes in the actual scale

marwi123

Can you show some screenshots of your scene and components that you're using?

Make sure you dont have multiple WebXR components in the scene (or maybe multiple WebARSessionRoot objects).

marwi123

If you dont find the culprit please send a bugreport and we'll try to look at it the next few days.

firas00904

I just opened a new project, loaded the sample in and it was working. I might have ticked something off or deleted a game object whilst testing.

firas00904

<@272528485732450305> hello marcel, i have one more question. Is there a way to end the AR session programatically, instead of the user having to exit it.

marwi123

Just in case you need it and if you're not familiar with it yet ๐Ÿ™‚ via this.context you also get the camera, renderer, root scene and so on

firas00904

thats amazing thank you! On a side note, I have exported the project out to Needle Cloud. I am also using https://play.eyejack.xyz/ to make it work with app clip. Its working and i am able to play the AR. However, the AR HTML overlay are not working. Is this something you have ever encountered ?

marwi123

HTML overlays are supported by Needle Engine if the browser or AppClip supports it (e.g. Chrome on Android with WebXR). In this case it seems eyejack has no support for HTML overlays but I'll check back. I think we reported this to eyejack and are in contact with them but will check back and let you know.

firas00904

Oh okay thank you. Is this something i can workaround? Do you think there is another tool? Variant launch maybe

firas00904

<@272528485732450305> hello marcel, i couldnt find anything online about removing the little X on the top right that exits the AR. Would appreciate if you can point me in the right direction!

marwi123

Hello <@755346535168081920> will look into it, I'm not sure if there's an option exposed right now but if not I think we can add one with the next update.

marwi123

<@755346535168081920> here's how you can override the default button (or provide your own button UI):

  <needle-engine>
    <div slot="quit-ar"></div>
  </needle-engine>

This replaces the default X with an empty element (making it invisible and not clickable). (docs)

firas00904

hello <@272528485732450305> , for some reason the AR placement adjustment is set to off, but the AR scene is weridly still moving on touch. Am i missing anything or?