Hi,
I am pretty new to Unity and I was wondering if anyone could help me. I want to know if there is a way to get the coordinates of where the mouse is on the screen. Can someone please post a snippet of code showing me how. Also could the coordinates than be put in 2 variables?
Thanks
GAMing
private void Update () {
Debug.Log(Input.mousePosition);
}
left-up is (0, 0)
Thanks but how would I than get it to variables as I would need the position later in my code
in the definition
float posX;
float posY;
setting values code
private void Update () {
posX = Input.mousePosition.x;
posY = Input.mousePosition.y;
}
later you can use posX and posY <: