How do you get the vector3 Coordinates of a mouse hover?

hi, I’m working on a scaling by a point of reference feature, and I’m trying to show a text near the cursor that calculates the distance between a mesh and the pointer current position in the scene, now the thing is is that I can’t figure out to get a vector3 coordinates from a “onPointerMoveObservable” without picking something.

It has to actively show the distance between the first ball mesh and the pointer.

Here is the PG of my prototype https://playground.babylonjs.com/#LET49V#26

To activate the functionality you need to press g and select the “firstPoint” on the image, then the “secondPoint” and the “thirdPoint” (the one that should do a dynamic scaling after I solve this issue) and that’s were the text should follow the mouse. line 240 to 252 is where I tried to use the observable.

This might help: Screen xy to world coordinates - #9 by 16ar

1 Like

Hey sorry for the late response but I actually looked at your link and after a bit of researching I managed to make it work!.. with a bit of a problem, while the text now shows and the functionality works at intended I can’t use any of the other GUI elements.

this is my current PG https://playground.babylonjs.com/#LET49V#34, to recreate the functionality simply press G then set a point, then another one and you got the meter counter running, the issue now is while it runs the inputText (the green box on the top left) for some reason can’t be pressed anymore. What did I did wrong here?

Adding @DarraghBurke for the GUI