hit.texturecoord always 0,0

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;
    }
}

removed

Print out the name of the thing that you’re colliding with, make sure it’s what you think it is.

I dunno, tested your code (ported to c#), using cubes, spheres, etc (2 mesh colliders, turn on convex on at least one) and it worked.

well,thx for testing it. after reading your post i’ve just deleted both objects and recreated them the same way and it works :confused: