Skip to content

A way to find the id of an Instanced Mesh with onCollide function? #106

Discussion options

You must be logged in to vote

Okay, finally I got this! The reason is that useCannon sees the collision as an interaction between objects — in our case it is instancedMesh and another object. So, when instancedMesh collides, useCannon sees the whole object and can't distinguish one of the many meshes from another.

So the solution was to switch from instancedMesh to an array of meshes and to handle all the logic inside each of them.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by codynova
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant