- Home /
Question by
samsmith0 · Aug 02, 2020 at 09:38 PM ·
texture2dimageraycastingraycastallsetpixel
Finding a pixel in an images texture by raycast
I am trying to find the specific pixel that the mouse cursor is over so I am able to access it and set it using Texture2D.SetPixel . I am currently using EventSystem.current.RaycastAll to raycast to the image however a RaycastResult does not include a textureCoord to get this information from the hit. Is it possible to get the pixels location on the texture using the hits RaycastResult.worldPosition and how could I do this?
Comment
Your answer