Raycast not detecting distance of my GameObject

I have 2 Models both have Box Colliders and Rigid Bodies attached.
Both have the detection script as mentioned below.

1st model is detecting the 2nd model object if comes infront of it but the other one is not detecting the 1st object :frowning: Please Help

Below is the code for detecting object through raycast.

function FixedUpdate () {

var distance : int = 5; 
if(Physics.Raycast(transform.position, Vector3.forward , hit , distance))
    if(hit.collider.tag == "Car")
             Debug.Log("There is something infront of object");



Yes and both of them are assigned this tag… Just now I found something that Both my cars were having Box Colliders and by looks both colliders were infront of each other and on runtime I just slightly reduced the Y position of one Box Collider on 1st car and it started detecting the 2nd car and 2nd car also started detecting the 1st one.

That was annoying for me because they were just at the right positions but were not detecting each other untill I check and set the positions of the colliders :frowning: