LineRenderer
7/14/25About 4 min
LineRenderer
Info
LineRenderer inherits from [Renderer](/docs/create/lua/API/Renderer/index.html)
The line renderer is used to draw free-floating lines in 3D space.
Members
Properties
| Name | Description |
|---|---|
LineRenderer.alignment | Select whether the line will face the camera, or the orientation of the Transform Component. |
LineRenderer.endColor | Set the color at the end of the line. |
LineRenderer.endWidth | Set the width at the end of the line. |
LineRenderer.generateLightingData | Configures a line to generate Normals and Tangents. With this data, Scene lighting can affect the line via Normal Maps and the Unity Standard Shader, or your own custom-built Shaders. |
LineRenderer.loop | Connect the start and end positions of the line together to form a continuous loop. |
LineRenderer.numCapVertices | Set this to a value greater than 0, to get rounded corners on each end of the line. |
LineRenderer.numCornerVertices | Set this to a value greater than 0, to get rounded corners between each segment of the line. |
LineRenderer.positionCount | Set/get the number of vertices. |
LineRenderer.shadowBias | Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the line width at each segment. |
LineRenderer.startColor | Set the color at the start of the line. |
LineRenderer.startWidth | Set the width at the start of the line. |
LineRenderer.textureMode | Choose whether the U coordinate of the line texture is tiled or stretched. |
LineRenderer.useWorldSpace | If enabled, the lines are defined in world space. |
LineRenderer.widthCurve | Set the curve describing the width of the line at various points along its length. |
Inherited Members
Inherited Properties
| Name | Description |
|---|---|
LineRenderer.allowOcclusionWhenDynamic | Controls if dynamic occlusion culling should be performed for this renderer. |
LineRenderer.bounds | The bounding volume of the renderer (Read Only). |
LineRenderer.enabled | Makes the rendered 3D object visible if enabled. |
LineRenderer.forceRenderingOff | Allows turning off rendering for a specific component. |
LineRenderer.isPartOfStaticBatch | Has this renderer been statically batched with any other renderers? (Read-Only) |
LineRenderer.isVisible | Is this renderer visible in any camera? (Read Only) |
LineRenderer.lightmapIndex | The index of the baked lightmap applied to this renderer. (Read-Only) |
LineRenderer.lightmapScaleOffset | The UV scale & offset used for a lightmap. (Read-Only) |
LineRenderer.lightProbeProxyVolumeOverride | If set, the Renderer will use the Light Probe Proxy Volume component attached to the source GameObject. |
LineRenderer.lightProbeUsage | The light probe interpolation type. |
LineRenderer.localToWorldMatrix | Matrix that transforms a point from local space into world space (Read Only). |
LineRenderer.material | Returns the first instantiated Material assigned to the renderer. Modifying material will change the material for this object only. |
LineRenderer.materials | Returns all the instantiated materials of this object. |
LineRenderer.motionVectorGenerationMode | Specifies the mode for motion vector rendering. |
LineRenderer.probeAnchor | If set, Renderer will use this Transform's position to find the light or reflection probe. Otherwise the center of Renderer's AABB will be used. |
LineRenderer.realtimeLightmapIndex | The index of the realtime lightmap applied to this renderer. |
LineRenderer.realtimeLightmapScaleOffset | The UV scale & offset used for a realtime lightmap. |
LineRenderer.receiveShadows | Does this object receive shadows? |
LineRenderer.reflectionProbeUsage | Should reflection probes be used for this Renderer? |
LineRenderer.rendererPriority | This value sorts renderers by priority. Lower values are rendered first and higher values are rendered last. |
LineRenderer.renderingLayerMask | Determines which rendering layer this renderer lives on. |
LineRenderer.shadowCastingMode | Does this object cast shadows? |
LineRenderer.sharedMaterial | The shared material of this object. |
LineRenderer.sharedMaterials | All the shared materials of this object. |
LineRenderer.sortingLayerID | Unique ID of the Renderer's sorting layer. |
LineRenderer.sortingLayerName | Name of the Renderer's sorting layer. |
LineRenderer.sortingOrder | Renderer's order within a sorting layer. |
LineRenderer.worldToLocalMatrix | Matrix that transforms a point from world space into local space (Read Only). |
LineRenderer.gameObject | The game object this component is attached to. A component is always attached to a game object. |
LineRenderer.tag | The tag of this game object. |
LineRenderer.transform | The Transform attached to this GameObject. |
LineRenderer.hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
LineRenderer.name | The name of the object. |
Inherited Methods
| Name | Description |
|---|---|
LineRenderer.GetMaterials() | Returns all the instantiated materials of this object. |
LineRenderer.GetPropertyBlock(materialIndex=-1) | Get per-Renderer or per-Material property block. |
LineRenderer.GetSharedMaterials() | Returns all the shared materials of this object. |
LineRenderer.HasPropertyBlock() | Returns true if the Renderer has a material property block attached via SetPropertyBlock. |
LineRenderer.SetPropertyBlock(properties, materialIndex=-1) | Lets you set or clear per-renderer or per-material parameter overrides. |
LineRenderer.BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
LineRenderer.CompareTag(tag) | Is this game object tagged with tag ? |
LineRenderer.GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
LineRenderer.GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
LineRenderer.GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
LineRenderer.GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
LineRenderer.GetComponents(type) | Returns all components of Type type in the GameObject. |
LineRenderer.GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
LineRenderer.GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
LineRenderer.SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
LineRenderer.SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
LineRenderer.TryGetComponent(type) | Gets the component of the specified type, if it exists. |
LineRenderer.GetInstanceID() | Returns the instance id of the object. |

