Hello,
I added a Debug.DrawLine to a script I found, and it’s supposed to show me the raycast in the scene view.
However, it draws a line from the correct first position to a random one, not 10 units forward.
Any help?
#pragma strict
function Update () {
var fwd = transform.TransformDirection (Vector3.forward);
Debug.DrawLine (transform.position, Vector3.forward * 10, Color.red);
if (Physics.Raycast (transform.position, fwd, 10))
{
print ("There is something in front of the object!");
}
}