Hello
Sorry I’ve tried figuring this out myself but not got anywhere with it.
I’m trying to pass userData into instances within an instancedMesh. I appreciate each instance will have it’s own instanceId but I’d like to pass in other details to the individual instances if possible.
In this link I’ve set up a grid of boxes. I see from the docs that userData is a property on an Object3D, which I’m using in my instancedMesh (denoted as temp
). So on lines 17-19 I’m trying to pass in some data to the userData property. On line 38, within the onClick method I’m trying to console out what I believe is the intersected object so that I can see its userData, however it’s coming out as empty.
Is this possible to do?
Any help would be greatly appreciated!
Cheers
Steve