Line Renderer Disappears

Hello, I’m working on AI Detection & i’m trying to display the radius of the raycast through a line renderer, the only problem is when i walk away from the line rendered it cuts out before it leaves the screen, heres a video of an example https://www.youtube.com/watch?v=yWtYlzpjYb4&feature=youtu.be

is there any way to fix it cutting out like that?
or can anyone suggest a way to display a radius on the screen in the same shape of what i have in the video.
any help would be greatly appreciated
thanks!

  • Jabez

if I had to guess, I'd say that the renderer uses OnBecameInisible() { OnBecameVisible() { which is called when the object enters/leaves the view.. so perhaps try using http://docs.unity3d.com/Documentation/ScriptReference/Renderer-isVisible.html and enable it if it isn't visible and is indeed disabled when leaving the view of the camera ?

–

I've just encountered this problem myself. In a line render that is straight, or mostly straight, it will stop rendering if it is more than half off screen. Been searching around all day for a solution, but I can't find anything relevant. I wish I could just set isVisible, but it's read only. If anyone has a good work-around, I would love to hear it.

–

1 Answer

1

I think the line renderer behind-the-scenes code is causing this. I don’t think it is possible to force it to draw all the time. I would recommend procedurally creating your own simple mesh and using that instead of the line renderer.