Cannot touch 3D collider after touching a UI Button.
Hello. In my scene I have 3D objects with colliders as well as some Buttons on a Canvas. When built to my Android device (galaxy S10), tapping the 3D objcets and tapping on the Buttons triggers the desired effects...except for one situation. If I tap a Button then tap a 3D object, the first tap on a 3D object does not trigger the effect. The second tap and all following taps on the same 3D object successfully trigger the effect. It's as if there is a state that needs to be cleared after tapping a Button by tapping anywhere other than on a UI element in order for me to tap on a 3D object again.
This also occurs when when I click on a Button to load another scene. Once the scene loads, my first tap on a 3D object is ignored and all taps on 3D objects that come afterward are successful (unless I tap on a Button of course).
I've replicated this issue using the OnMouseUp() function to capture the touch on 3D objects, as well as casting a ray from from screen space on touch to trigger the effect on the 3D objects. I saw no change in behavior from a user's perspective.
Haven't found a solution in other related UI Canvas and 3D collider interaction issues. I appreciate any and all help. See attached images for the settings of my Buttons and Canvas. Button Settings:
Canvas Settings:
Answer by mzlotkowski84 · Feb 06, 2020 at 10:23 PM
I found my own workaround. I had been using OnMouseUp() and the end phase of a touch as the triggers for the 3D objects. As a workaround, I'm now using OnMouseDown(). This hasn't shown any interference with the Buttons or vice versa. Ended up making the experience feel a bit more responsive as well, so I'm OK with this. Still no fix for my original issue though.