So I have almost all the controls finished for my game, I’m now looking into swipe to look controls, I couldn’t find much on them really anywhere, so I decided to write my own, and didn’t think they could be that hard. Here’s my code, I don’t now what’s wrong with it, but when using unity remote I don’t even get the first debug.Log to be called. Any help would be greatly appreciated. Here’s the code. In the code I was first working on just the left and right looking, then I’d implement up down to.
var aPosX;
var bPosX;
var moveMag;
function Update () {
for (var i=0; i < iPhoneInput.touchCount; i++){
var touch : iPhoneTouch = iPhoneInput.touches[i];
if(touch.phase == iPhoneTouchPhase.Began){
aPosX = touch.position.x;
Debug.Log(aPosX);
if(touch.phase == iPhoneTouchPhase.Moved){
bPosX = touch.position.x;
Debug.Log(bPosX);
moveMag = aPosX - bPosX;
Debug.Log(moveMag);
}
}
transform.Rotate(0,moveMag,0);
}
}