Is is possible to get/set userData of a single object within InstancedMesh?
I’m looking to use raycaster to select the object and get the userData of that object.
Is is possible to get/set userData of a single object within InstancedMesh?
I’m looking to use raycaster to select the object and get the userData of that object.
The raycaster’s intersection data contains instanceId. You can use the original userData as an array of individual userData-s of instances. When you get the instanceId, you just get the instance’s data from userData[instandeId]. Hopefully.
– Pavel
Should’v think of that.
Thanks.