Hi,
I have a ball, as a rigidbody, using gravity to bounce off the ground the way balls do in real life. So far so good. I want to “catch” the ball (ie, stop it moving) when clicked with the mouse, and then be able to “throw” the ball with the mouse, ie, the ball will travel in the direction the mouse is swiped once the mouse button is released, and still be subject to gravity. In other words, I want to imitate real life catching and throwing a ball, with the mouse acting as somebody’s hand.
I’ve tried lots of different techniques, but am at a loss as to where to start. I assume I should use AddForce, but how do I stop it from moving once the mouse is clicked, and how do I get the direction the mouse has moved in before letting go of the mouse button?