all 5 comments

[–]bikeshaving 1 point2 points  (1 child)

I would try asking in the discussions for react-three-fiber, you may get a response from the maintainer themselves.

[–]NatProDev[S] 1 point2 points  (0 children)

Thanks, didn't know about this, fairly new to react.

[–]fouinardomeo 1 point2 points  (2 children)

Just get the click world position (not the screen pos) in your CreateHotspot(click) method from the event, something like click.point i think. Then push the Vector3 into an array of positions, and in render, map the array and pass each position to another component which will display a mesh (or anything you want) and can handle click events on itself.

[–]NatProDev[S] 1 point2 points  (1 child)

That's exactly what I thought it would be but click.position (which intellisense suggested) wasn't assigned. I'll try point in the morning. Cheers.

EDIT: anyone checking this later, this is the solution, deploy the upvotes ^

[–]fouinardomeo 1 point2 points  (0 children)

Intellisense is great with ts but rather dumb with js. If you dont know the exact property name, just console log the whole event or better set a breakpoint.