- Home /
Question by
Lautaro-Arino · Dec 04, 2013 at 09:38 PM ·
cameraguiposition
Gui object to mouse position
If i have a secondary camera where i place gameobjects as gui in front of the gui camera and want to move one of the gui gameObjects to the mouse position. How do i get the correct vector 3 so that the gui gameObject moves to where the mouse is?
Comment
Best Answer
Answer by Statement · Dec 04, 2013 at 10:09 PM
Try transforming the screen space mouse position into world space via that camera.
http://docs.unity3d.com/Documentation/ScriptReference/Camera.ScreenToWorldPoint.html