fateriddle Posted October 11, 2018 Share Posted October 11, 2018 I read the picking collision part of the document, https://doc.babylonjs.com/babylon101/picking_collisions And //When click event is raised window.addEventListener("click", function () { // We try to pick an object var pickResult = scene.pick(scene.pointerX, scene.pointerY); }), Is really helpful. But if I import a new asset ( gltf ) into my scene, it is more than likely the object consists of 20-40 meshes, then how do I know if I hit the object, even if the pickResult.hit === true? Quote Link to comment Share on other sites More sharing options...
fateriddle Posted October 11, 2018 Author Share Posted October 11, 2018 Btw, it'll be really helpful that Babylon.js can have a discord channel. Other popular frontend frameworks all have their big discord servers. Quote Link to comment Share on other sites More sharing options...
droggam Posted October 11, 2018 Share Posted October 11, 2018 There Always a way to hack or bruteforce crack THE code... IF u can code u can iterate over all meshes in THE array.. And My car object has Windows,tyres, etx in it, i also hear about getmeshbyname method i think. And with your pickresult method u can att least console.log (picked.mesh) So there is a way for sure.. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 11, 2018 Share Posted October 11, 2018 We are not like all popular frameworks We keep the forum only because then you only have one place to search (and to maintain). So as @droggam mentioned, you can mark all meshes as pickable (and while doing that, you can use the mesh.tag to store some info for you that you could then use to determine that the picked mesh was actually part of a big group) Other option: on picking, you can use pickedMesh.isDescendantOf(yourRootMesh) ssaket 1 Quote Link to comment Share on other sites More sharing options...
fateriddle Posted October 12, 2018 Author Share Posted October 12, 2018 9 hours ago, Deltakosh said: We are not like all popular frameworks We keep the forum only because then you only have one place to search (and to maintain). Thanks for the answer. Sometimes it is just a quick question followed by some back and forth, and discord do help because of its format. Right now I kinda have 10-20 questions, and I don't know how ppl here will feel if I spam them all out and occupy the whole front page. Also the longer waiting in forum is a thing. I don't necessary think discord will be an overlay to this fantastic forum, they serve different purposes. As user, I throw / answer quick questions in discord, and sometimes just read ppl there talking about new trends or how they do things, which helps a lot. But again I fully understand your decisions, and thanks for helping! Quote Link to comment Share on other sites More sharing options...
kcoley Posted October 12, 2018 Share Posted October 12, 2018 Hi @fateriddle you can mark a mesh as pickable by setting its "isPickable" property to true e.g. cube.isPickable = true Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.