I've had Traceline implemented for a while to help my flying navigation, and have tracked down a serious problem that I'm having with it. Sometimes, if Traceline is being called while my character is updating his movement, it will return NoCollision instead of Collision (when there is clearly a collision).
To test this: I put one static location on one side of a tree, and another static location on the other side of the tree. Then, I called Traceline every frame, printing the result. When I stand completely still, it constantly returns "Collision" as it should. However, when I hold my mouse button down and rapidly look around (back and fourth, basically just spinning my mouse), it sporadically returns NoCollision. I'd say that when I'm spinning my mouse as fast as I can, about 10% of the time it'll return NoCollision. This occurs whether I use my right mouse button or left mouse button.
Also, I've found that when this occurs, it doesn't matter how many times I've called Traceline. Even if I set three different static locations that should all return Collision, all three will bug out simultaneously when I'm spinning my mouse.
Any thoughts on how to fix this? I suppose that I could simply call Traceline several times of a few frames, but that's quite messy and I'd obviously prefer not to.