Following bug appears in this Playground example:
Playground Example
The position of the selectionMesh
is often incorrect—it appears on the floor instead of on top of the button when trying to press the button. I’ve experienced similar issues in every scene I’ve created, and I can’t find the cause.
Due to this bug, I’d like to completely hide the selectionMesh
.
- The class lacks a property or method to disable it:
Documentation for WebXRNearInteraction - Could we get an option similar to what exists for the pointer:
displaySelectionMesh
:
Documentation for WebXRControllerPointerSelection - If feasible, consider adding
disableSelectionMeshLighting
andselectionMeshDefaultColor
for NearInteraction. - Here’s the hacky solution I’m using to work around the issue:
protected disableNearInteractionSelectionMeshes() {
// Find all meshes with the name "nearInteraction"
const nearInteractionMeshes = this.scene.meshes.filter(mesh => mesh.name === "nearInteraction");
// Iterate over the meshes and disable them
nearInteractionMeshes.forEach(mesh => {
mesh.setEnabled(false);
console.log(`${mesh.name} is set to disabled`);
});
}
- Additionally, using Near Interaction sometimes feels imprecise. For example, hitting a slider is difficult unless the slider is made very tall. I might write more about this in the future.