Skip to content

API > LineRenderer


LineRenderer⚓︎

LineRenderer inherits from Renderer

The line renderer is used to draw free-floating lines in 3D space.

Members⚓︎

Properties⚓︎

Name Description
LineRenderer.alignmentProperty Select whether the line will face the camera, or the orientation of the Transform Component.
LineRenderer.endColorProperty Set the color at the end of the line.
LineRenderer.endWidthProperty Set the width at the end of the line.
LineRenderer.generateLightingDataProperty 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.loopProperty Connect the start and end positions of the line together to form a continuous loop.
LineRenderer.numCapVerticesProperty Set this to a value greater than 0, to get rounded corners on each end of the line.
LineRenderer.numCornerVerticesProperty Set this to a value greater than 0, to get rounded corners between each segment of the line.
LineRenderer.positionCountProperty Set/get the number of vertices.
LineRenderer.shadowBiasProperty Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the line width at each segment.
LineRenderer.startColorProperty Set the color at the start of the line.
LineRenderer.startWidthProperty Set the width at the start of the line.
LineRenderer.textureModeProperty Choose whether the U coordinate of the line texture is tiled or stretched.
LineRenderer.useWorldSpaceProperty If enabled, the lines are defined in world space.
LineRenderer.widthCurveProperty Set the curve describing the width of the line at various points along its length.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
LineRenderer.allowOcclusionWhenDynamicProperty Controls if dynamic occlusion culling should be performed for this renderer.
LineRenderer.boundsProperty The bounding volume of the renderer (Read Only).
LineRenderer.enabledProperty Makes the rendered 3D object visible if enabled.
LineRenderer.forceRenderingOffProperty Allows turning off rendering for a specific component.
LineRenderer.isPartOfStaticBatchProperty Has this renderer been statically batched with any other renderers? (Read-Only)
LineRenderer.isVisibleProperty Is this renderer visible in any camera? (Read Only)
LineRenderer.lightmapIndexProperty The index of the baked lightmap applied to this renderer. (Read-Only)
LineRenderer.lightmapScaleOffsetProperty The UV scale & offset used for a lightmap. (Read-Only)
LineRenderer.lightProbeProxyVolumeOverrideProperty If set, the Renderer will use the Light Probe Proxy Volume component attached to the source GameObject.
LineRenderer.lightProbeUsageProperty The light probe interpolation type.
LineRenderer.localToWorldMatrixProperty Matrix that transforms a point from local space into world space (Read Only).
LineRenderer.materialProperty Returns the first instantiated Material assigned to the renderer. Modifying material will change the material for this object only.
LineRenderer.materialsProperty Returns all the instantiated materials of this object.
LineRenderer.motionVectorGenerationModeProperty Specifies the mode for motion vector rendering.
LineRenderer.probeAnchorProperty 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.realtimeLightmapIndexProperty The index of the realtime lightmap applied to this renderer.
LineRenderer.realtimeLightmapScaleOffsetProperty The UV scale & offset used for a realtime lightmap.
LineRenderer.receiveShadowsProperty Does this object receive shadows?
LineRenderer.reflectionProbeUsageProperty Should reflection probes be used for this Renderer?
LineRenderer.rendererPriorityProperty This value sorts renderers by priority. Lower values are rendered first and higher values are rendered last.
LineRenderer.renderingLayerMaskProperty Determines which rendering layer this renderer lives on.
LineRenderer.shadowCastingModeProperty Does this object cast shadows?
LineRenderer.sharedMaterialProperty The shared material of this object.
LineRenderer.sharedMaterialsProperty All the shared materials of this object.
LineRenderer.sortingLayerIDProperty Unique ID of the Renderer's sorting layer.
LineRenderer.sortingLayerNameProperty Name of the Renderer's sorting layer.
LineRenderer.sortingOrderProperty Renderer's order within a sorting layer.
LineRenderer.worldToLocalMatrixProperty Matrix that transforms a point from world space into local space (Read Only).
LineRenderer.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
LineRenderer.tagPropertyReadonly Property The tag of this game object.
LineRenderer.transformPropertyReadonly Property The Transform attached to this GameObject.
LineRenderer.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
LineRenderer.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
LineRenderer.GetMaterials()Method Returns all the instantiated materials of this object.
LineRenderer.GetPropertyBlock(materialIndex=-1)Method Get per-Renderer or per-Material property block.
LineRenderer.GetSharedMaterials()Method Returns all the shared materials of this object.
LineRenderer.HasPropertyBlock()Method Returns true if the Renderer has a material property block attached via SetPropertyBlock.
LineRenderer.SetPropertyBlock(properties, materialIndex=-1)Method Lets you set or clear per-renderer or per-material parameter overrides.
LineRenderer.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
LineRenderer.CompareTag(tag)Method Is this game object tagged with tag ?
LineRenderer.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
LineRenderer.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
LineRenderer.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
LineRenderer.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
LineRenderer.GetComponents(type)Method Returns all components of Type type in the GameObject.
LineRenderer.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
LineRenderer.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
LineRenderer.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
LineRenderer.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
LineRenderer.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
LineRenderer.GetInstanceID()Method Returns the instance id of the object.