An artificial potential field method based on global path guidance (G-APF) is proposed for target unreachability and local minima problems of the conventional artificial potential field (APF) method in complex environments with dynamic obstacles. First, for the target unreachability problem, the global path attraction is added to the APF; second, an obstacle detection optimisation method is proposed and the optimal virtual target point is selected by setting the evaluation function to improve the local minima problem; finally, based on the obstacle detection optimisation method, the gravitational and repulsive processes are improved so that the path can pass through the narrow channel smoothly and remain collision-free. Experiments show that the method optimises 40.8% of the total path corners, reduces 81.8% of the number of path oscillations, and shortens 4.3% of the path length in Map 1. It can be applied to the vehicle obstacle avoidance path planning problem in complex environments with dynamic obstacles.