Using if (Physics.Raycast (ray, out hit, etc, etc) {
and some code, the raycasts are ignoring mesh collider. Tested using a cube in the same position, and it works. Yes I am using appropriate layer for both that I have set up. Makes no sense. Normals of mesh are not reversed because the mesh is shaded with texture correctly. It would be invisible from top if normals were flipped. Makes no sense. Can someone do a simple test? It is an imported non primitive shape. It is terrain shaped.
EDIT: Did a test in a new project/scene. Used imported meshes and it worked, they were pretty basic, a cube, a plane, and a subdivided plane (very low triangles though). Tried importing the original mesh I was working with, which is about 8000 tris, 4500 verts, still does not get hit by the raycast. I am wondering if there is a hidden limit enforced on raycasting topology? Or maybe there is something wrong with the mesh somehow?
After a lot of tests, I believe it is the mesh. I don’t understand what could be wrong with it. Especially when it still collides with rigidbodies, and the normals are facing correctly. What all could be wrong with any given mesh that I can look into?