I want to calculate the degree of a touch location away from the centre of my screen. Currently I have this code:
var myVector : Vector3;
var myAngle : float;
function Update () {
if ( iPhoneInput.touchCount > 0 ){
for(var touch : iPhoneTouch in iPhoneInput.touches) {
myVector = new Vector3(240, 160, 0);
myAngle = Vector3.Angle(myVector, touch.position);
}
}
}
The problem is that it doesn't really work. The degree's it comes up with are wrong and even if you do a full 360 loop around the point it doesn't exceed 50 at any point, does anyone have any idea why?