Adjusting variable by mousePosition

I have this script:

speed = basespeed + Input.mousePosition.y*.2;

which kind of does what I want - it adjusts the speed of something depending on how “high” the mouse is. What I don’t like about it is that it will perform very differently depending on how large the window is that the game is being played in. Also, I would like it so that if the user moves the mouse down enough it goes into the negatives. So basically - it is window dependent now and I want it to be window independent. Any advice?

if you do:

Mathf.Clamp01(Input.mousePosition.y/Screen.height);

it will always give a value between 0 1 no matter how large your screen is.

Thanks. That does help. I see now how Mathf.Clamp can be useful. Another mystery grown a little less dim for me.