Hotspot for Mouse

Hi, I’m working on a little project.
I would like to know if there’s an easy way to put an Hotspot on my Mouse (even I’m moving it)
I didn’t find something about that on the forum, and in internet I can’t find something JS.
If someone can help or just have example ?
(I’d like to do it by myself I’m just looking for some help)

Thanks :slight_smile:

Hi.

Do you want to change your cursor image or what?..

If so, you have to change css property cursor on your body element.

Can you describe or show an image/video of the effect you are trying to create?

Hey! Yes it’s almost that but I’d like to do it all in JS.
I would like to have a 3D asset (that I have already) following my mouse.

Oh, then you need to project your mouse position into 3D world and place something there.

Probably this tutorials should help
https://developer.playcanvas.com/ru/tutorials/entity-picking/
https://developer.playcanvas.com/ru/tutorials/simple-shape-raycasting/

Hi !
I’d like that my mouse have something like this when I launch my project but it’ll not be a picture but a 3D asset.

svg

Thanks!
I already the first link but not the second one that could help me.
Thank you very much for your time :wink:

Hm…

Now i’m not sure it’s a best solution.
Take a look at this function
https://developer.playcanvas.com/en/api/pc.CameraComponent.html#screenToWorld

Probably this one is what you need.

That looks better thanks !