hi there , i am trying to create a simple puzzle game , and i have a problem , that is when in my game i drag the object , if i move my finger fast on the screen fast , the object stops following my finger , but if i move it slowly it is ok , …
here is my code :
case TouchPhase.Began:
if (object1.GetComponent<Collider2D>() == Physics2D.OverlapPoint(touchPos))
{
object1ismoveing = true;//
object2ismoveing = false;//
object3ismoveing = false;//
deltaX1 = touchPos.x - object1.transform.position.x;
deltaY1 = touchPos.y - object1.transform.position.y;
}
break;
//
case TouchPhase.Moved:
if ((object1Collider == Physics2D.OverlapPoint(touchPos)) && object1ismoveing
&& !object2ismoveing && !object3ismoveing)
object1.transform.position = new Vector2(touchPos.x - deltaX1, touchPos.y - deltaY1);
break;