0

Unity: I want to push a picture up with a finger keeping touch the screen, and the picture should move with the finger at the first time when this gesture begin. Just move y position, but don't change x.

public void CallEvent() {

    case GestureState.Up:
        if(this.gameObject.name == "Cover") {
            this.transform.DOMove(new Vector2(0, _MousePos.y), 0.5f);
        }
        break;

}

I refresh this method each time when finger moving is detected, the object is also moved but not in the way I wished. Actually the x and y positions are quite far away from where its should be.

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
heinzQ
  • 23
  • 2
  • You need to convert your mouse pos from screen space to world space – Ruzihm Dec 02 '21 at 16:30
  • Does this answer your question? [Working with the coordinate system and game screen in Unity 2d?](https://stackoverflow.com/questions/21937544/working-with-the-coordinate-system-and-game-screen-in-unity-2d) – Ruzihm Dec 02 '21 at 16:30

0 Answers0