How can I place a object to position where I clicked in just x,y axis not in z, I am trying to achieve it with
Vector3 mousepos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
object.transform.position = new Vector3(mousepos,mousepos);
but it does not seem to work, in fact the object doesn't even move.
new Vector3(mouspos,mousepos);
This isn't valid syntax. There's no Vector3 constructor that takes two Vector3s as arguments. What is it you're trying to do with this? \$\endgroup\$