So i have been developing this classic game for training where the player is shooting bullets to some weirdly-shaped enemies. Initially, i had the very common problem of bullets going way too fast through some collider which is not triggered when the bullet passes through it (this target is not solid). So i implemented the raycast test which basically creates a raycast between the position of the bullet in the current frame, and the position of bullet in the previous frame, checking for collision hits. This step worked fine, but raycast lead me to another problem: The edges/borders of this target ARE solid (just like a ring or torus, if the bullet collides with the borders then the bullet may ricochet in or out of target area). So, if the bullet ricochets OUT of the target area, the constantly-moving ring may still catch up with the previous position of the bullet when it ricochet. In other words, suppose frame A is exactly when the bullet collides with the ring border at position P, the next frame B the bullet is ricochet out of the ring and not in touch with the borders anymore, meanwhile the ring target area has moved into position P, therefore raycast hit between frames A and B will find a collission.
How can i overcome this problem?
Hope i made myself clear, Thank you in advance