- Home /
How to detect the Fragment under the cursor directly, without using mesh collider
In my application, i'm rendering a human body, and users could add decals on it (tattoo). One solution is easy-decal but it requires a collider (mesh collider) to know where to position the decal when the user clicks on the body (raycast), but this method is too slow. I tried changing the reference mesh of the mesh collider to some low-poly mesh, but to no avail.
I want to know if its possible to ignore raycasting and colliders, and detect the fragment under cursor (when user clicks) and also pass some variables to the shader such that the clicked fragmet and fragments in its vicinity are shaded (textured) with decal.
No, as far as I know, there is no way to bypass the collider aspect efficiently.
I was looking for a solution to a similar problem and found this asset, can only recommend it. If you don't want to pay for it, post your code. Raycasting should be efficient enough for simple decal adding.
Your answer
![](https://koobas.hobune.stream/wayback/20220612191813im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Passing values from Shader to C# script 0 Answers
Raycast and Instantiate 1 Answer
Raycasting Collider Problem 0 Answers
How can I let the ray to the edge of the capsule? 1 Answer
Raycast crashing build on collision with mesh collider 3 Answers