Height from mouse drag speed

Hi all!

I need to launch a ball in 3D world using physics with mouse drag. I made this:

rigidbody.AddForce(new Vector3(mouseDirection.x, 0, mouseDirection.y).normalize * force);

The question is: how I can calculate the height by the speed? Highter is speed, highter is height but I don’t know how to apply it…

Ps the drag is made from bottom to top

Thanks in advance

This is an example of what I need but in 3d:

alt text

Those are 3 throws… The highter is the force, the highter is the height, but how can I calculate the height if mouseY is used for Zaxis?

Thank you

If I’m understanding you correctly it is similar to what I’ve done in one of my own games. What I did was apply the mouse axis to a variable and then applied that variable’s value to AddForce. It would look something like this:

mouseDir += Input.GetAxis("Mouse Y"));

Then apply that to AddForce. Hope that helps.