hey. I want to get maximum x and y values of mouse position when the player pressing the mouse key.
i got the values of all the x’s and y’s. but i can’t figure out how can i eliminate maximum ones and stock in variables. here’s my code:
void FixedUpdate () {
if (Input.GetMouseButton (0)) {
Vector3 posa = Camera.main.ScreenToWorldPoint (Input.mousePosition);
float x = posa.x;
float y = posa.y;
Debug.Log (x);
Debug.Log (y);
}
}