I am using the iPhone and I have a problem tracking my finger movement. I have a sprite on screen and when I touch the sprite I want it to move where ever my finger moves. The problem is that I am moving my finger too fast and the script I wrote doesn't refresh enough to catch this case. Right now the script is FixedUpdate() function. Would the script update faster in the Update() function? Any help would be appreciated.
here is my code:
function Update()
{
if(iPhoneInput.touchCount == 1 && iPhoneInput.GetTouch(0).phase == iPhoneTouchPhase.Moved)
{
oneThrow.ray = Camera.main.ScreenPointToRay(iPhoneInput.GetTouch(0).position);
oneThrow.OldPosition = oneThrow.gameObjectGuy.rigidbody.position;
if(collider.Raycast(oneThrow.ray, oneThrow.mrHit, 1200))
{
//test code that occures when the ray has collided with
//the booger
Debug.DrawLine(oneThrow.ray.origin, oneThrow.gameObjectGuy.transform.position , Color.red);
//end test code
//code
oneThrow.StopChangeFromRandom = true;
oneThrow.WalkLeft = false;
oneThrow.WalkRight = false;
oneThrow.PackedSprite.defaultAnim = 2;
oneThrow.PackedSprite.PlayAnim("Idle");
print("Ray Direction " +oneThrow.ray.direction+ "!!!");
oneThrow.gameObjectGuy.rigidbody.position = Vector3((oneThrow.mrHit.point.x), (oneThrow.mrHit.point.y), (oneThrow.mrHit.point.z));
}
oneThrow.rayValue = oneThrow.ray.direction.x;
print("rayValue = " +oneThrowr.rayValue+ "!!!");
}
}