Understanding Documentation - teach me to fish

I run into this time and time again due to my lack of experience in programming. When I’m reading documentation like the one below, are there clues that I’m missing on how to use examples? Are they alls cripts that you attach to a prefab or g.o.? What is it that tells me that, or is it obvious. :sweat_smile:

Like the Gizmos link and info below, to do this simple example do I create a script and attach it to a game object, a camera… ( I tried both of those and didn’t see a red line)

I was reading from the Script Reference to Gizmos.DrawRay

It has the following script:

function OnDrawGizmosSelected  () {
// Draws a 5 meter long red line in front of the object
Gizmos.color = Color.red;
direction = transform.TransformDirection (Vector3.forward) * 5;
Gizmos.DrawRay (transform.position, direction);
}

The red line appears in the scene view when the object is selected (also the game view if you have the Gizmos button on).

–Eric

Thanks! Wheres the Gizmos button?

Between “maximize on play” and “stats”.

–Eric

Thanks!