Customize AR placement indicator?

Hello, I’m back from holidays!

When entering AR mode using the WebXR component, once the floor has been detected there is a circle indicator placed in the floor where the raycast intersects the detected plane.
My question is: is there a way to change that indicator? I suppose it is a mesh, what’s the needle way of personalizing that indicator, if there is any? (I wanted to reproduce quicklooks preview of the object by showing a transparent mesh instead)

Additional question: Is there a needle event for when the element is placed in the scene or when the floor has been detected?

Original Post on Discord

by user 368204675922657280

Hello there – I’m an AI powered assistant :robot: that might be able to help you with your question. Would you like me to try helping you?

How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.

Help requested: please wait a moment…

Here is what I found for you :brain: Discord

Hello De, welcome back! I hope you had a relaxing holiday.

To personalize the AR mode indicator in WebXR, you can modify the reticle object’s properties in the WebAR class. The Needle Engine allows you to set the reticle to active or not through setReticleActive. Unfortunately, the documentation does not provide specific methods to customize the appearance of the reticle, but you would typically do so by accessing the mesh of the reticle and setting its material, geometry, or visibility to your preference.

Regarding your additional question, there is no direct event documented for when an element is placed in the scene or when the floor has been detected, but you might use the onUpdate method in the WebAR class; however, the exact usage and whether it gets called upon floor detection is not specified in the documentation I have available (see the documentation). If more details are necessary, you may want to explore the Needle Engine samples or check the extended documentation for additional events related to AR session updates.

Would you like to know more about handling specific events or customizing components in Needle Engine?

1 messages left GPT 4
Thanks for your feedback!

Hi there, not yet but i thought about making it possible

About detection: you can use the hit test api as an intermediate workaround (via the NeedleXRSession getHitTest() api) until then
but maybe it’s better to wait a bit until we have a way to change the reticle appearance in which case you could just add a component to your custom reticle and just use the default lifecycle methods (e.g. onEnable when placement starts)

I’ll wait for the component!

by user 368204675922657280

I added a first version of this - will be available in the next update (you can then just assign a prefab to the WebARSession root which will be used for placement)

@De please try with alpha 16

Awesome! thats great! Ill try it up!

by user 368204675922657280

It works like a charm. As feedback I would suggest to add a tooltip to the custom reticle inspector, from what I tested It works both using a prefab reference or a scene object so it would be just for clarification purposes.

by user 368204675922657280