- Home /
RaycastHit Texturecoord doesn't work with separate colliders
I am trying to make a palette and color picker. If I use a simple plane and with mesh collider on it and click on an area, with the help of GetPixels, I do get the correct result. But the problem is, that even if I click on the whitish framework of the Palette, which has circular array of colors otherwise, it still collects the result. To tackle this, I used separate Mesh Colliders in color areas of the Palette on screen. But now whenever it hits the colliders, the RaycastHit only gives 0,0 Coordinates, as a result of which I always get a black color.
How do I make this work?
In the absence of a sample project to play with, I think this will be a difficult question to get an answer to. As a workaround, you could have a second texture to act like a mask. The second texture would define what areas a clickable and what areas are not. Assu$$anonymous$$g it is the same size (or at least the same aspect), you could use the same uv coordinates to check clickability.
Your answer
![](https://koobas.hobune.stream/wayback/20220613132751im_/https://answers.unity.com/themes/thub/images/avi.jpg)