So I am running into some issues with seeing an extremely short line when I am drawing a ray using debug.DrawRay. I’m trying to setup a visible rayCast gizmo to get a visualization of the control ray I am using to move my character. Here’s the code I am using to do this.
bool interactionRay (Vector3 location) {
Ray ray = Camera.main.ScreenPointToRay(location);
Debug.DrawRay(ray.origin, ray.direction, Color.green);
return Physics.Raycast(ray, out hit);
}
I was under the impression that a ray was supposed to cast for an infinite direction until it hits something, however in the editor this is what I am seeing.
The raycast is obviously working since the character is pathing to it’s strike point however the debug ray is not following the same path. It’s not even reaching down into a place where it’s visible by the game camera. Any idea why this might happen? Have I misunderstood how the Debug ray drawing gizmo works? I don’t see any option in the ray object itself to set it’s length.