For debugging, I would like to know how to project a line out of the direction of the player’s z axis using Debug.Drawline, unless their is a better solution?
1 Answer
1This will draw a green line for 5 seconds in the forward direction of the player.
Debug.DrawLine(transform.position, transform.position + transform.forward * 10.0, Color.green, 5.0);
I’m assuming that is what you mean by “player’s z axis”.
Thanks again. Updated this for anyone who can use this also. Debug.DrawLine(transform.position, transform.position + transform.forward * 10.0, Color.green, 5);
– GlitchBait
Since it is the purpose of it, I don't think there is any better solution. Note that it is quite simple to use, (start, end, color). Now if you want to draw on the game you need to use LineRenderer.
– fafaseDebug.DrawLine(Vector3.zero, new Vector3(0, 0, 3), Color.red,60,false); I agree. I've actually tried several ways to get it to display (and I've checked that my gizmos are on) but I'm not seeing anything in any direction.
– GlitchBait