Skip to content

Format

typescript
Gizmos.DrawLineWithColor(p1, p1_color, p2, p2_color, depthTest)

class: Gizmos

Description

Draws a colored straight line from p1 to p2.

Parameters

param_nametypedescription
p1Vector3Starting coordinates
p1_colorColorColor of the starting coordinates
p2Vector3Ending coordinates
p2_colorColorColor of the ending coordinates
depthTestboolean?Whether to perform depth testing

Return

typedescription
void

Code Example

typescript
OnUpdate(): void {

    let p1 = new Vector3(0,0,0);
    let p1_color = Color.red;
    let p2 = new Vector3(5,5,5);
    let p2_color = Color.green;
    Gizmos.DrawLineWithColor(p1,p1_color,p2,p2_color,false);
    
    }