how to create object on mouse position

hello, I want to instantiate object on mouseposition, when I click on mousebutton. I tried Camera.ScreenPointToRay, but it moves very little and if I multiply the origin.x or orign.y then the object appears high or very right.

Can you post the code that you are using?