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.
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);
}