I'm using a basic method of determining touch and positioning a collider at the touch position which will interact with game objects. Is this an ok way of working with touch or should I be using a different method. The use is for touching various objects that are floating about. Camera is orthographic.
code below is for collider:
var hit : RaycastHit;
function Update () { var ray = Camera.main.ScreenPointToRay (Input.mousePosition); for(touch in iPhoneInput.touches) { if (Physics.Raycast (ray, hit, 100)) { if(touch.phase == iPhoneTouchPhase.Moved || touch.phase == iPhoneTouchPhase.Began) { transform.position = Camera.main.ScreenToWorldPoint(new Vector3 (touch.position.x, touch.position.y, 10)); } } } }