To get the ball position:
private var xPos:float;
private var yPos:float;
xPos = ballObject.position.x;
yPos = ballObject.position.y;
Then you get the distance between your mouse click and ball position, see from [here][1].
You can just use the distance to determine how powerful the force will be.
[1]: http://unity3dtutorial.com/unity-3d-tutorials/dealing-with-directions-movement-in-unity-3/
↧