Particle swarm optimization (PSO) is a search algorithm based on stochastic and population-based adaptive optimization. In this paper, a pathfinding strategy is proposed to improve the efficiency of path planning for a broad range of applications. This study aims to investigate the effect of PSO parameters (numbers of particle, weight constant, particle constant, and global constant) on algorithm performance to give solution paths. Increasing the PSO parameters makes the swarm move faster to the target point but takes a long time to converge because of too many random movements, and vice versa. From a variety of simulations with different parameters, the PSO algorithm is proven to be able to provide a solution path in a space with obstacles.