Vector3 to Float? Trying to accomplish a MouseDrag..

I’m trying to archive to shoot a proyectile based on the Mouse Movement (not related to the world, so no raycasts :frowning:

How can I make it so that my mouse position gets converted into a float_>?? I looked into mousedrag, but frankly i havent gotten it after alot of googling.

		if(Input.GetKey(KeyCode.V)){
		var dragAmount : Vector3;
		
		Debug.Log("Aim and shot");
		
			if(Input.GetMouseButtonDown(0)){
				firstPosit = Input.mousePosition;
				}
			if(Input.GetMouseButtonUp(0)){
				lastPosit = Input.mousePosition;
				}
		dragAmount = lastPosit-firstPosit;

Convert dragAmount into a float???

		Debug.Log( "delta X	 : " + lastPosit.x);
		Debug.Log( "delta Y	 : " + lastPosit.y);

thanks guys.

You want the distance of the drag?

var dist = Vector3.Distance(lastPosit, firstPosit);

note : this will give you a value in screen pixels when using Input.mousePosition