Hi, I am trying to create a game where the player drops a cube from the top of the screen to the bottom, collecting points on the way down depending on where they dropped the cube from (like a Coin Pusher arcade game).
At the moment I am able to have my cube move to the mouse, but this in both X and Y values. See - Camera.main.ScreenPointToRay(Input.mousePosition); Vector3 mouse = Input.mousePosition; mouse = mouse; transform.position = Camera.main.ScreenToViewportPoint(mouse);
I am keen to have movements only on X but am unsure how to achieve this.
I have ‘fixed’ the issue by changing the first posts code to:
Vector3 mouse = Camera.main.ScreenToViewportPoint(Input.mousePosition);
transform.position = new Vector3(mouse.x, transform.position.y, transform.position.z);
But the movement from a mouse is very slow and not very responsive. Is there a way to speed up, or more accurately follow my mouse movements?