Manual     Reference     Scripting  
  
Scripting > Runtime Classes > Debug   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Enumerations
  • History
  • Index
  • Debug
  • All Members
  • Class Variables
  • isDebugBuild
  • Class Functions
  • Break
  • DrawLine
  • DrawRay
  • Log
  • LogError
  • LogWarning

Debug.DrawRay  

static function DrawRay (start : Vector3, dir : Vector3, color : Color = Color.white) : void

Description

Draws a line from start to start + dir with color.

// Draws a 10 meter long green line from the position
// forward along the transform's z-axis.
function Update () {
var forward = transform.TransformDirection(Vector3.forward) * 10;
Debug.DrawRay (transform.position, Vector3.forward * 10, Color.green);
}