Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
0
Members

Mouse focus on a 3D object [solved]

A topic by LeonisCuriosity created Jul 04, 2017 Views: 463 Replies: 2
Viewing posts 1 to 3
(1 edit)

Hi there !

I have a problem : is there any function or way to know if my mouth is focusing an object in a 3D context ?

Here is my problem : I have a box, and I want to execute an action when I click on it. But the thing is that my camera can move. So I can't use the getMousePosition method which only returns 2D coordinates...

thank you !

Hey guys !

After hours in the deep of Internet, I found this awesome module :

fMouse
GitHubhttps://github.com/florentpouj...
npmhttps://www.npmjs.com/package/...

That was exactly what I was looking for !

I hope this would be helpful for others !

Ray.SetFromCamera -> Ray.intersect -> hit.distance