Stupid problem: clicking on terrain/buildings

For my demo project I wanted to implement some basic isometric game. I managed to detect clicks on terrain with this code:

//mouse clicks 
	if (Input.GetButtonDown("Fire1")) {
           
        Ray ray = Camera.allCameras[0].ScreenPointToRay(Input.mousePosition);
	RaycastHit hit;
 		
        if (Physics.Raycast(ray, out hit, 1000.0f)) {
                Debug.Log("Mouse Down Hit  "+hit.collider.gameObject.name);                
                GameObject charObj = GameObject.Find("character");
                charObj.transform.LookAt(hit.point);                 
            } //if physics
     }// if Input.GetButtonDown

I wanted to detect if the ray hit a building, and added Raycast collider to all of them. But they are ignored, and only the terrain receives clicks. Any idea about what Im doing wrong?

Just to be clear, which type of collider have you added to your buildings? If you are using the RaycastCollider class to the buildings then it won’t do what you expect. You should just use the primitive collider types (box, sphere, capsule) or mesh colliders for the buildings.

Yes, i added a raycast collider, i thought it was the correct one, as I was using a ray to detect terrain clicks.