studentutu/Tilia.UnityUI

Canvas selection only works at certain angles with tillia pointer straight

Closed this issue ยท 12 comments

Ituno commented

From what i could tell from the way the selection seems to work right now, and granting that i did not mess up the setup, is that if the angle of the pointer is perpendicular or pointing up (so the origin is lower from the button) the button can be highlighted and pressed. Otherwise it does not. I also found out that if i pass the laser through the other hand (and it correctly stops on the hands collider) it somehow still raycasts through it and the angle problem dissapear. I don't know how to adress or what more info I should give but this is a wierd interaction I could not find a real solution to

that is a weird issue - it should use any angle - as it solely relies on UIRaycasts (casting to UIElements) - so no angles whatsoever.
Could you provide a sample project/scene where this issue is reproduced?
It looks like you have something on the hands, a collider possibly, which interacts with UI raycasts. You can actually offset your UI Pointer away from your hand collider so that it won't interact with it.

Ituno commented

I will try and make the scene for you, the problem however happens not on your test level, we tried it on our, the same exact canvas made into a prefab and moved from your test level(on which it works) and on our level it just does not detect buttons below the half of the canvas if the pointer is inclined downwards(taller than the canvas).
However thanks for the fast response, sorry for my slow one . I will get back to you with a smaller version of the project so you can take a look.

I don't currently have VR with me anymore.

Could you create a new project and recreate some of the scripts and prefabs to suit the need for this issue?
Remove unnecessary plugins and such, otherwise, I can't help you, as it seems it works fine on the default scene.

I will try to make a web version with standalone support, but we need to reproduce it on a sample scene/sample small project.

Still can't reproduce, but I have found another minor issue and also made a new release ( please see breaking changes before updating)

cooloo commented

I have the same problem.

cooloo commented

222
333
Please check the image,I think the problem is the method "IsIntersectedByRay".

Good morning, I have tried all kinds of variations - still can't reproduce on the test scene with default buttons/toggles/dropdowns/scroll-view. Can you make sure - you don't have anything overlapping those buttons? @cooloo @Ituno

Good morning,
I have this same issue, but I narrowed down the issue to the VRTK4_3DGraphicRaycaster.
It's blocking mask is set to Default.

When I have a 3D object with a collider behind my UI then I am unable to click the button, but when I remove the 3D object or change its layer to something else, then the button works.

Am I mis understanding the VRTK4_3DGraphicRaycaster Blocking Mask?
I assume it's there to tell you which layers block your ray caster?
But in this case the UI is in front of the 3D object, so it shouldn't block the interaction.

Anyone else have this issue, or know what I'm doing wrong?

image
I can click the green bit, but nothing in the red I can click, because on the pillar behind the UI.

There might be a bug with the cast towards the UI if Collider is behind. Need to look into it

Thanks @studentutu
Please let me know if you find anything.

Working on the fix right now, updated Test scene and also reproduced.

Fixed in v3.0.3. It was caused by incorrect sorting at the end of the processing inside VRTK4_VRInputModule. Fixed it by using sorting from the default UI, but if event modules are different -> will use comparison only on the distance.

Thank you for contributing to the improvement of this package!
@cooloo @JamesSozoLabs @Ituno