gizmo.drawline question : point a to b

How do you get gizmo.drawline to not base off of the world axis, but the rotation of the object itself?

I’m trying to get it to cast only between a and b based off its own rotation and position. The engine is using the word axis and makes an infinite line.

Gizmos.DrawLine (transform.position, transform.right * dist);

thank you

Gizmos.DrawLine does not draw infinite lines. It draws a line from two specified points. To test, try this:

function OnDrawGizmos () {
        Gizmos.color = Color.red;
        Gizmos.DrawLine (Vector3(0,0,0), Vector3(1,0,0));
    }

Which will draw a line 1 unity long starting at the origin. As for your code, what I think you want is:

Gizmos.DrawLine (transform.position, transform.position + transform.right * dist);

if you want a gizmo of a finite or infinite line, you need to use rays, Gizmos.DrawRay, check the overloads of that method