Quantcast
Channel: Answers by "stevenp"
Viewing all articles
Browse latest Browse all 16

Answer by stevenp

$
0
0
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/

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>