First thing first! Here’s my code!
#pragma strict
private var distance : float = 5.0;
function Update () {
var ray = new Ray(transform.position, -Vector3.right);
var hit : RaycastHit;
if(collider.Raycast(ray, hit, distance)){
Debug.Log(hit.transform.name);
}
Debug.DrawLine(ray.origin, ray.origin + ray.direction * distance);
}
Seems pretty much 90% the same as it is in the help file.
But the raycast doesn’t detect the other collider! (trust me, it has a collider, and it is intersecting!)
125125
Can anyone tell what I’m doing wrong?