Creating a LineRenderer

Hi everybody, I’m new at this forum :).

I’m scripting in javascript to trying to create a Line in Unity with LineRenderer, but I dont’t know how to do it.

I just want to create a line between the point (0,0,0) and (0,5,0) and assign it a default ‘fire add’ material.

¿Can you show me the code lines to create this?
I have been looking in manual but I don’t know how to do it. (Sorry for my bad english)

:slight_smile: Thanks in advance!

nobody? :slight_smile:

Hm, I think any answer I would give would just be a repeat of what’s in the documentation. Did you look at both the Component page and the Scripting page? If so, can you specify what you’re having trouble with?

I have been looking in the links you showed to me, but I can’t see example line code. I just want to create a line starting and ending in the point I specificated, and assign it a material. No more…

In javascript.
Thanks four your response

Have you tried using AddComponent yet?

I don’t know how to add the component…
In the reference doesn’t explain how to do it.

¿can anyone help me?
:slight_smile:

thank you

It’s all there, just copy/paste and edit the scriptname

You can also add new components from the Component menu (Line Renderer is under ‘Miscellaneous’).