ML 2, Simulation, Interactions, Unity

**Unity Editor **: 2022.2.21
**ML2 OS **:1.3.0-dev2
**MLSDK **:1.8.0
Host OS: Windows 11
ML App Sim: 3.6.0

I've run Control scene from ML examples. Editor don't report any issue but i have problem with interaction to UI elements.

In logs and on UI view i get information "Receiver trigger" but it does not affect to UI.

I am totally new in ML SDK. What i can do to test interaction in Unity Editor?

i want to switch from Overview to Controls as on the screen

What is your app sim target? Is it a device, simulator, or hybrid?

Simulator only. I don't have device

Video:

Hi @kulwik,

I went ahead and tried to reproduce this issue. It seems that the simulator creates illusions due to transforming a 3D projection onto a 2D screen and the ray's draw order. So when the ray is not hitting a UI element that can be interacted with, it turns red. It passes through the UI which makes it seem as though it's pointing at the UI element. However, in this example scene if the ray is red, it is not hitting any UI elements. I have changed the rendering mode to two-eyed in the app simulator to help demonstrate this.

2023-07-07_12-12-30

In the screenshot above, the unity scene shows that the ray is passing through the non-selectable UI elements, but in the right eye view it seems like the ray is pointed at the 'X' button but it is actually behind it. If you move the controller around in the scene view of the app simulator by selecting it and changing the manipulation mode to "rotate."

After rotating the controller, I was able to get the ray to turn white and I was able to select the UI elements as shown below.

Let me know if this helps.

Best,

El

1 Like

Hi @etucker

Ohh now i see. In editor i rotate all body, not the controller. So i couldn't focus ray to the top buttons because window was moving with me. I rotate controller as you suggest and everything is ok.

Look at the ray lenght. It wasn't clear for me at the begining and i was trying to point at the buttons using the end of ray. But correct is somewhere at the middle.

Two-Eye or one-eye. Don't matter in UI, but yeah. Better to not use Two-Eye in simulation.

In UnityEditor
AppSimRendering -> Device View -> Two-Eye Rendering
or
In App Sim Device View there is button
Screenshot 2023-07-10 103809

Is there easier method to rotate controller? Not whole body.

Hi @kulwik,

I'm glad I was able to help you solve this issue. The best way to rotate the controller only is to select the controller and switch the manipulation mode to 'rotate' and it should have some handles that allow you to rotate the controller to your desired orientation.

Best,

El