- Home /
Convert vector in world to mesh
Hi
The question is related to:
http://answers.unity3d.com/questions/140978/raycasting-from-center-of-spherecollider.html
I can obtain hit point,but in world space,and I need it in space of the mesh.How could I do such?I tried RaycastHit.barycentricCoordinate,yet those values seems not right :/
Answer by Eric5h5 · Jul 10, 2011 at 06:20 PM
InverseTransformPoint, probably.
I've find out that on my own,yet it gives me a strange results.If I display hit.point then move a mouse cursor just one milimeter then the hit point changes as could be expected.If I use transform.InverseTransformPoint(hitPoint) then I get results like (0.1,-0.0,0.1) and what's is much worse there are still the same if I place my mouse cursor a centimeter away from previous location :/