Getting mouse position in unity

I’m trying to move a object to the mouse position. But it’s giving me large x value like 300 but at that place the pre placed object’s x position is -4.

rigidBody.velocity = new Vector3(Input.mousePosition.x, EndPointY, 0)*4;

So how can I get the current mouse position?

Thank you..

Leave a Comment