Line Renderer

Has anyone gotten a line renderer to work? I have work that works in the preview window but my app crashes when downloaded to the device.

I have short line renderers sort of working - but with problems. I want to display them behind a partially transparent GUI-image and at first they look correct, then they turn black for a moment, and finally they appear in front of the gui… not too nice.

And the Trail Renderer (according to the docs that’s basically the same tech) doesn’t even display in the editor… That’s the one I would really need…

Unity Team - what’s the word on trail and line renderers?

Can we expect a fix shortly?

please say yes, you good unity people :]

As far as we’re aware, Line Renderers should work in Unity iPhone 1.0. If this is not the case, and you have a project where they are misbehaving, please log a bug using the Report Bug application inside the Unity iPhone folder. This is the best and most efficient way to communicate issues to us… much better than posting to the forum and waiting for a reply :slight_smile:

I did this.

var lineRender: LineRenderer;

And it complained I couldn’t do that. I deleted my js file, created a new js file, added the same code above and it was fine. I haven’t replicated this. This was from moving my project from unity over to unity iphone.

I reported a bug last week, but without example. So now I reported another one with a simple project attached… Hope it helps to fix the issue! - Can’t wait to have them working on the iPhone :]

Hello

We have this bug also. The line renderer crashes on the iPhone when we try to enable it or to activate it. Just a few times it works without an apparent reason.

We have tried many combinations and different shaders but the problem seems to be the LineRenderer itself.

I hope this can be identified by Unity and solved soon. In the meantime, are there any workarounds to show a modifiable line?

Thanks

You might try the TubeRenderer in the meantime. I doubt it performs spectacularly well on the iPhone, but worth a shot.

Thanks StarManta

However I am getting the following error:

On the following line:

GetComponent(MeshFilter).mesh = mesh;

Looking at your code I am wondering if it is possible to recreate the line renderer with just a few vertices. I don’t need it to rotate to face the camera so I guess it would be possible. I will try it when I make your script work.

Solved replacing the line with the following code:

var filter : MeshFilter = GetComponent(MeshFilter); 
filter.mesh = mesh;

Thanks again StarManta.

Hello StarManta

I set the cross segments to 2 and it shows the wanted line on the editor. But it does not show the line on the iPhone. :cry:

Have you tried it on the iPhone yet?

Does anyone know if this was ever addressed? I have a project that locks up hard each time I instantiate a primitive with a line renderer in it. If I turn of the line renderer it works fine, not code changes. Any special trick to getting this to work in Unity iPhone or am I out of luck with my lines?

Hello mediamacros

We are using a thin cube shape to recreate the line.

Andres

I discovered this tip in a badly named thread. It got the line renderer working for me.

I finally went with a small cylinder. Worked fine and allowed for some other nice glow effects, etc. It does it every time in my project, but not in every project I tried, so there is some other factor that effects it.