Skip to content

Entity ID different in PickingEvent::Clicked than what I originally stored when using glTF #197

Answered by aevyrie
Newbytee asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aevyrie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants