Hi,
I am trying to have my character sprite follow the mouse position on one axis, which works. However the amount that the character moves is very limited. Below is the code:
void moveLR (){
Vector2 mouse = Camera.main.ScreenToViewportPoint (Input.mousePosition);
transform.position = new Vector2 (mouse.x, transform.position.y);
}
I don’t understand why moving my character sprite is not following the X position of the mouse entirely. If I am not communicating what I mean very well, I can submit a demo of the game to show the problem in action.
Any help on intensifying movements in this code? I am more than happy to recreate the function from scratch in order to have the mouse follow the X Axis properly.
Thanks,
Kittik