- Home /
Wire using line renderer
can I use line renderer to make electrical wire ? if yes, how I can check if camera is aiming at any point of line renderer and then select any point in line and get total length from the wire start to that point
If your line render isn't constantly having its points updated, you could get it to bake a mesh, put a mesh collider on it and raycast.
Otherwise you could check if the linerenderer's mesh is visible within the camera's frustrum, although getting the actual point where your camera's view would intersect between 2 points on the linerenderer would be difficult. This gets more difficult if the line renderer consists of 100s to 1000s of points and your wire is coiled.
But if you do find the point of intersection, it's just a matter of adding up the magnitude between each point from that intersection to the start point.
Your answer
![](https://koobas.hobune.stream/wayback/20220613042119im_/https://answers.unity.com/themes/thub/images/avi.jpg)