Raycast problems

Hi all. I am having trouble getting a raycast to go from a ship to the ground when I hold the mouse button down. Here is the script I have so far

var horizontalSpeed = 2.0;
var verticalSpeed = 2.0;
var particle : GameObject;
var myTransform : Transform;


function Update ()
{
    // Get the mouse delta. This is not in the range -1...1

    var h = horizontalSpeed * Input.GetAxis ("Mouse X");
    var v = verticalSpeed * Input.GetAxis ("Mouse Y");

    transform.Translate (v, 0, -h);


if(Input.GetMouseButton(0)){
//construct a ray from the mouse point
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if ( Physics.Raycast(myTransform.position, ray)){

Instantiate (particle, transform.position, transform.rotation);
}
//horizontalSpeed=0;
//verticalSpeed=0;

}
}

right now I get an error that says Assets/UFO.js(20,21): BCE0023: No appropriate version of ‘UnityEngine.Physics.Raycast’ for the argument list ‘(UnityEngine.Vector3, UnityEngine.Ray)’ was found. but I’m not sure where the arguments aren’t right. how can I get the raycast to go from the ship to the ground? Thanks!

Raycast have many overload, but basically it needs 1- Origine 2- Direction (and some option, not relevant here. You can either give a ray, which contains those two informations, or the origine and the direction (both Vector3). Try :

if( Physics.Raycast(ray) )

or

if( Physics.Raycast(ray.origin, ray.direction) )

if ( Physics.Raycast(myTransform.position,-Vector3.up, ray)){

}

Ushould specify the direction in which you want to cast the ray…