I want to instantiate an object at the raycast's point of collision. Here is the script I have so far:
function Update ()
{
if (Input.GetButtonDown("Fire1"))
{
var ray : Ray = camera.ScreenPointToRay (Vector3(200,200,0));
Debug.DrawRay (ray.origin, ray.direction * 10, Color.white);
}
}
Any help? I've seen sample scripts, but they're interfering with the fact that the raycast is coming from the camera. I am a beginner at this.