I use a line Renderer to draw a trajectory graph for a granate throw. I want, that when the Line hit any ground, it stops and paint a texture on the ground. How can i do that ? The texture thing is not that important but would be cool.
You would have to make a script that iterates over the lines of your trajectory, casts a physic ray for each line, and checks for the first collision along the trajectory. Actually, for performance reasons it’s best to cast one ray for multiple lines, as you probably want the rendered lines to be pretty small, but you don’t want that many raycasts. There’s probably more optimizations to be made depending on your project, but that’s a start.