The Butterfly Optimization Algorithm is one of the most recent nature-inspired algorithms that mimic the butterflies' behavior in mating and finding food, for solving the global optimization problems. The algorithm utilizes the sense of butterflies of smelling for determining the location of nectar and find mates, which is based on the foraging strategy of those insects. This paper represents a method of using the BOA algorithm for solving the problem of path planning in three-dimensional space. The proposed method finds a path from a particular starting point to any chosen goal, where the generated final path is completely safe and collision-free. The algorithm is based on 3 phases: the initial phase, the iteration phase, and the final phase. The movement of butterflies is based on two search moves, one of them is Local random search; where the butterfly moves randomly within the swarm, and the other is Global search; where the butterfly moves towards the best-fitted butterfly in the current population. The proposed method in this paper is able to find a collision-free path from the start point to the goal in all of the presented test environments in proximately well performance and the results were computed in terms of execution time and path length.