So this the script I currently am using but for some reason the raycast always points at other direction
var Hit : RaycastHit;
Debug.DrawLine( transform.localPosition, transform.forward * 100 , Color.blue);
if( Physics.Raycast( transform.localPosition, transform.forward * 100, Hit))
{
Debug.Log(Hit.collider.name);
}
This is the image. As you can see, the raycast is not pointing along the local z-axis as
it was meant to.