Following mouse

Alright so I hate to ask a question on something so broad but im not sure were to start.
I want a platform to follow my mouse when it moves. To do this i figured if i could find a way to convert my mouse position to a world position and set that to a variable then i could measure the change and work form there. The only thing is that i dont know how to do really anything with the mouse and so was wondering. How can I set the mouses position as a variable? also i use C#

Did you try looking Here?

You could cast a ray from the camera that passes through the mouse point, and get the position where this ray hits something - this is useful when you want the platform to keep a constant height above the ground:

float height = 3; // height above the ground
Transform platform; // drag the platform here

void Update(){
  // create a ray passing through the mouse pointer:
  Ray ray = camera.ScreenPointToRay(Input.mousePosition);
  RaycastHit hit;
  if (Physics.Raycast(ray, out hit)){ // if something hit...
    // move the platform to the hit point:
    platform.position = hit.point + height * Vector3.up;