getPixel co-ordinates not screen co-ordinates based on mouse position

Hi, im trying to get the x,y co-ordinates of a pixel to use in the GetPixel function. I have tried using a raycast to get the hit position based on Camera.main.WorldToScrenPoint however this gives a screen co-ordinate, not a pixel co-ordinate on the readable texture.
So how do you do it, by that i mean get pixel co-ordinates off a specific texture in the scene when the mouse is over it. check out textureCoord

You should use the Raycast, but from the RaycastHit structure returned, get textureCoord: it’s the UV coordinates of the pixel hit. The docs give in the link above an example of how to set the pixel hit - it’s probably easy to adapt to your case.