u must use mouse raycast for
something like this add this to ur update func
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
GameObject urOBJ=GameObject.FindWithTag("urobjTAGname");
if( Physics.Raycast( ray,out hit) )
{
if(urOBJ)
{
urOBJ.transform.position=new
Vector3(hit.point.x,hit.point.y,0);
}
↧