Problem with raycasts and instantiating

var Blood : Transform;


function OnMouseDown () {
var other : RaycastHit;

if (Physics.Raycast (transform.position, Vector3.forward, 3)) {
var theClonedBlood : Transform;
if (other.collider.tag == "Person"){
theClonedBlood = Instantiate(Blood,
other.normal, transform.rotation);
print ("hi");
}
}
}

My gameObject that has this script points directly at my collider that is tagged “Person” and nothing happens! It doesnt even say hi

anyone?

Add another print(“raycast hit somthing”); before you test the tag to see if its the raycast that is the issue or the tag check. Other then that it looks ok but I work with C# and not 100% sure of the quirks of unityscript.

Also add a Debug.DrawRay(transform.position, Vector3.forward, 3); to see where the raycast is going.