Greetings,
It seems the following code does not work. I can still click through my GUI window and move my camera. Please help ![]()
`
if (Input.GetMouseButton(0) && GUIUtility.hotControl == 0)
{
var dx = Input.GetAxis("Mouse X");
var dy = Input.GetAxis("Mouse Y");
var dV = new Vector3(-dx * 0.15f, -dy * 0.15f,0f);
var newPos = Camera.main.transform.position + dV;
newPos.x = Mathf.Clamp(newPos.x, minX, maxX);
newPos.y = Mathf.Clamp(newPos.y, minY, maxY);
Camera.main.transform.position = newPos;
}
`