I used this code to move my player
private void MovementMobile()
{
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved)
{
Vector3 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
float step = touchDeltaPosition.x;
Vector3 target = new Vector3(step, 0, 0);
transform.Translate(target * touchSpeed * Time.deltaTime);
}
}
I call MovementMobile function in Update, but movements are not smooth enough. My game input is similar to Sky Ball, Stairs or Splashy games for expample (you can check app stores). Basically, I try to create kind of “bouncing ball” game, so I use physics. I tried to move rigidbody itself via MovePosition but result is the same - ball stutters.
Can’t move on because of this problem