Raycast detecting colliders issue w/ image depicting problem
Hey!
TLDR: My game utilizes fast moving arrows that use raycasts to detect collisions, and embed the arrow into an object. Sometimes, the raycasts decide not to detect an object with a collider.
Things to note: I have a Debug.Log statement that logs the name of the object that it should have detected, without any other filters like tags and layers, and it does only log names when it embeds into an object, and it doesn't log the names of objects that it skipped through, so that leads me to believe it's not an issue within my script that decides whether or not to embed the arrow.
Also, the Debug.DrawRay is an exact representation of the ray that's supposed to detect the collision.
I know this question has been asked a lot, but I can't find any with answers that don't have answers that aren't just assuming that the raycast isn't long enough or are skipping over colliders in some frames, so in order to prove that my Raycasts are adequately long, I've provided an image that uses Debug.DrawRay to show that the Raycasts per update are actually long enough to overlap themselves, yet while casting through colliders, they simply do not want to detect them.
The image depicts 6 arrows that were shot, 2 that detected the post, and embedded into the post appropriately, 2 that skipped the post (even though the rays draw right through collider) and embed into the plane (plane mesh with flat box collider), and 2 arrows that managed to skip both the post and the plane.