Raycast that curves towards nearest zombie

I have a very simple raycast function and I want to modify it so that when the player runs the raycast function, the raycast will curve towards the zombie nearest to the player, as opposed to going in a straight line like normal raycasts do.

Continue to help post