Mouse Press - create an object problem

Hey there
I am trying to get a object to be “printed” to a new location on the screen via a click of the mouse. The new position would therefore be the mouse x and y positions

heres what I have got so far

function Start()
{
renderer.enabled = true;
yield WaitForSeconds(2.25);
renderer.enabled = false;
}


function CreateObject()
{
  renderer.enabled = true;
  Input.mousePosition;
  yield WaitForSeconds(2.25);
  renderer.enabled = false;
}



function OnMouseDown () 
{
CreateObject();
}

I cant quite understand it ; I realise there must be some way of assigning the mouse x/y to the object but I have not found any relevant stuff to work through on here

I would be greatful if anyone has any suggestions as what to do

cheers

Camera.main.ScreenPointToRay (Input.mousePosition) or look at raycasting

thanks very much :smile:

worked to a degree trying that ; gona look at raycasting

cheers