RaycastHit Collider Question

function Update () {

	var fwd = transform.TransformDirection (Vector3.forward);
	var hit: RaycastHit;
    if (Physics.Raycast (transform.position, fwd, 100)) {
    	touchedCol = hit.collider;	
    }   
}

My code with raycasts barely ever works, I’m declaring the touchedCol variable already. I’m not getting errors, it’s just that the touchedCol variable isn’t returning anything.

Screenshot 2
[1406-BugScreen2.jpg|1406]

I’m stupid…

var touchedCol : Collider;
var length : float; 

    function Update () {
    	
    	var fwd = transform.forward;
    	var hit: RaycastHit;
        if (Physics.Raycast (transform.position, fwd, hit, length)) {
        	touchedCol = hit.collider;
        }
        Debug.DrawRay (transform.position, fwd * length, Color.green);   
    }