Want to display guiTexture at the exact position where my ray cast hit to the object

I am using hit.position for the coordinates of the gui texture but still that texture is not displayed on the proper position where I want. I want it at the hit point but its displayed bit away from that and I cant relate that position in my code. Is it possible to display that texture exact on that position and it should not change as player moves. It should stick with the hit point only. And should change as the hit point changes. Please help me

Try this function


GUITextures are placed in viewport space, I believe. Get the world point result of the raycast and pass through the function to get a 2D coordinate in Viewport space, which you use to place your texture.