# Creating A Line System

> Learn how to create line systems in Babylon.js.

Source: https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/line_system

## Line System
MeshBuilder only. A line system is a set of non-contiguous lines that are independent of each other and may exist in their own space. You must set at least the _lines_ option. On update, you must set the _lines_ and _instance_ options. You can also update the _colors_ option if it was previously set at construction time.

## MeshBuilder 
Usage :
```javascript
// creates an instance of a line system
let lineSystem = BABYLON.MeshBuilder.CreateLineSystem("lineSystem", {lines: myArray}, scene);

// updates the existing instance of lineSystem : no need for the parameter scene here
lineSystem = BABYLON.MeshBuilder.CreateLineSystem("lineSystem", {lines: myArray, instance: lineSystem});
```

option|value|default value
--------|-----|-------------
lines|_(Vector3[][])_  array of lines, each line being an array of successive Vector3 **REQUIRED**
updatable|_(boolean)_ true if the mesh is updatable|false
instance|_(LineMesh)_ an instance of a line system mesh to be updated|null
colors|_(Color4[])_ array of Color4, each point color|null
useVertexAlpha|_(boolean)_ false if the alpha blending is not required (faster)|true

### Examples
Example of a line system: [Playground: Line System Example](https://playground.babylonjs.com/#Y7CS4N) - Simple example of a line system.
Update of the line system: [Playground: Updating Line System Example](https://playground.babylonjs.com/#Y7CS4N#1) - Simple example of updating a line system.

Unlike a mesh, lines are colored after creation with a color property rather than a material.
```javascript
linesystem.color = new BABYLON.Color3(1, 0, 0);
```
Colored Line System: [Playground: Colored Line System Example 1](https://playground.babylonjs.com/#Y7CS4N#2) - Simple example of a colored line system.

You can produce multi-colored lines by setting the colors for each point of each line before creation.

- [Playground: Colored Line System Example 2](https://playground.babylonjs.com/#Y7CS4N#3) - Simple example of a colored line system.
