Plane object causes touch events to always be consumed by that plane, even if it is behind other 3D objects with colliders

I found a problem in the simulator where the touched object was incorrect when a Plane primitive object was present in the scene.

To reproduce: SampleScene, create a Plane object by selecting 3D Object->Plane from the hierarchy right-click menu. set position to (0, -0.3, 0) so that it exists below other 3D objects. Also, use SpatialPointerState.targetObject to get the name of the GameObject that is being touched and display it on the Canvas.

Build the project and launch it in the visionOS simulator; when you tap on an object such as a Cube or Tetra, it should display as Cube or Tetra, but it will display as Plane.

If Plane is not present, or if I replace it with a Cube of equivalent size instead of Plane, this problem does not occur. it seems to me that the Touch event is incorrectly consumed only when Plane is present.

I uploaded a Unity project which is a slightly modified version of template so that you can reproduce this issue.
Please check it out.

Environment:
Unity 2022.3.11f1
PolySpatial 0.4.1
Xcode 15.1 beta
VisionOS simulator 21N5259j

Hi,

I think the root cause of this is an issue in how the mesh collider on the Plane object is being set up in RealityKit. As a check, if you change the Mesh Collider on the Plane object to a Box Collider, does this issue persist? You can also double check the created collider sizes in the simulator with this toggle:

At any rate, can you submit a bug and attach that Unity project to it? Let us know the incident number as well, and we’ll look into it.

Thanks!

1 Like

Changing the Plane’s Mesh Collider to a Box Collider solves the problem.

I also checked the Collider in the simulator with the debug function when the problem is occurring (when the Mesh Collider is set), and it seems that the collider is larger than the actual visible object.

I submitted this bug via bug reporter, and the case ID is IN-57943

Thanks,

1 Like

I was struggling with this same issue until I found this forum post. Changing my plane’s collider from mesh collider to box collider seems to have solved the issue. I’m glad to have found this post! Thank you.

2 Likes