here is my little code, i thought it will be easy but the coords are always (0,0). I’ve found a lot of topics about it but all sad the problem can be if one of the colliders is not meshcollider. in my case both of them are, the raycast hit (there is the debug log) but the coords are always 0.
function OnCollisionEnter(collision : Collision)
{
Debug.DrawRay(collision.contacts[0].point-collision.contacts[0].normal,collision.contacts[0].normal,Color.red,15);
var hit : RaycastHit;
var ray : Ray;
ray.direction = collision.contacts[0].normal;
ray.origin = collision.contacts[0].point-collision.contacts[0].normal;
if(Physics.Raycast(ray, hit) ){
Debug.Log(hit.textureCoord);
hitcoord=hit.textureCoord;
}
}