Object should follow the mouse pointer

Hi there,

I would like my model to follow the mouse cursor, but I dont even know how to start.

Can someone help?

Hello, welcome to the forums! I recommend you visit the Useful Links section in the documentation to find some tutorials and courses on Three.js to get acquainted with how to achieve basic functionality such as this. Once you have tried something on code and run into tangible problems, then you can share your progress here so we might assist you further.

Hi marquizzo,

thanks for your answer. I already read a lot in the documentation, but because I am useing react with three.js a lot of things are different. I think plain three.js is much easier because the react three fibre docs are not that specific. Thats why I stuck a lot.

I already spend a lot of time learning, but it is really hard to get to the point…

Yeah, I don’t like react-three-fiber for this exact reason. It adds an extra layer of complexity to an already complex system, and people are less likely to be able to help out when you have two advanced libraries to be knowledgeable in. Plus I find the React ecosystem’s <xml /> + JavaScript syntax completely sloppy and convoluted.

You should give plain Three.js a shot! (Just my personal opinion, of course)



Are you looking for something like this? How to make gltf model always face mouse cursor? - #2 by prisoner849 Plain three.js, no r3f.