Hey guys!
So I got a question about how to find a point on an object using raycasting. Now I know how to raycast to something and get the hit data but my problem is that I’m trying to get exactly where it hit in terms of the objects dimensions as I want to do certain actions depending on where on the cube the raycast hits.
RaycastHit.point returns the point in world space which isnt what im looking for. So far I tried subtracting hit.point from the objects position but since the objects origin isnt in a corner it doesn’t return an accurate representation of where on the cube I hit. I drew a picture to explain what I want to get more.
(3, 5) being the point I wish to try and get from the raycast.