hey guys, I want to move the object with my finger. Code is as shown below. But it doesnt work properly. What is the problem??
var buttonForSFX: GUITexture;
if (iPhoneInput.touchCount > 0 buttonForSFX.HitTest(iPhoneInput.GetTouch(0).position))
{
if (iPhoneInput.GetTouch(0).phase == iPhoneTouchPhase.Moved)
{
if(iPhoneInput.GetTouch(0).position.x <= 338 iPhoneInput.GetTouch(0).position.x >= 127)
buttonForSFX.transform.position.x = iPhoneInput.GetTouch(0).position.x;
print("touch position" + iPhoneInput.GetTouch(0).position.x);
print("button position" + buttonForSFX.transform.position.x);
}
}