-
I'm making a small game with Bevy as an exercise to learn this engine, and as I need to detect when a user clicks on an object in the world with their mouse, I went looking for how to do that in Bevy and found this plugin! I'm using glTF, so I quickly ran into what's described in #163 and used the solution at #163 (comment) to resolve it. However, after doing this, I noticed that the entities inside the Do you have any ideas regarding what I might be doing wrong here, and how I can fix this? What I really need is some way to associate the Link to full "minimal" reproducible example here: https://github.com/Newbytee/bevy_picking_mre |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for providing an MRE, sorry I haven't caught up to this sooner. I haven't fully debugged this, but it looks like the issue is that you are storing the Assuming you are still interested in a solution, I would suggest taking a look at the event listener features that have been added recently. Specifically, bubbling will make this much easier to solve. In short, picking events automatically bubble up the hierarchy, allowing you to put event listeners with callbacks on the root |
Beta Was this translation helpful? Give feedback.
Thanks for providing an MRE, sorry I haven't caught up to this sooner. I haven't fully debugged this, but it looks like the issue is that you are storing the
Entity
of the piece, and the picking plugin is hitting the mesh, which is a child of the root piece entity.Assuming you are still interested in a solution, I would suggest taking a look at the event listener features that have been added recently. Specifically, bubbling will make this much easier to solve. In short, picking events automatically bubble up the hierarchy, allowing you to put event listeners with callbacks on the root
Piece
, and react when any of its children receives a picking event.