combine hit detection and path finding