I think maybe better solution would be to determine an angle between player’s forward vector and npc trace vector, and block movement only if it is less than FOV of the camera.
I think maybe better solution would be to determine an angle between player’s forward vector and npc trace vector, and block movement only if it is less than FOV of the camera.