overlayed multiple meshes problem #2731
shadybassily
started this conversation in
General
Replies: 1 comment 1 reply
-
onClick={e => {
e.stopPropagation() it is to be expected that it picks up on all meshes the raycaster is able to pierce. it's up to you to decide to stop it, using stopPropagation just like on the dom. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So currently I'm working on a carousel to display multiple planes that can be scrolled horizontally
![Screenshot from 2023-01-22 22-27-56](https://user-images.githubusercontent.com/85500332/213939005-e8d54511-528b-4e26-9df2-4843fbc475a7.png)
, one after the other, like a shelf.
technically the meshes are behind each other, but when I click on one mesh, the ones behind gets affected.
for example, and for testing purposes, I console.log the index of the plane I click on, when I click on the nearest mesh to the camera, on the center, it logs index 0, but if I click on the same plane but closer to the right edge, at least 2-3 meshes get affected, so it logs 0,1,2,3
does anyone know why this happens, and if there is a work around it, becase I will use each plane to display something different.
Beta Was this translation helpful? Give feedback.
All reactions