- Home /
Have Ghost go from Patrolling to Chasing - Pacman
I'm currently working on recreating Pacman in 2D (NOT 3D) and I am having trouble with one aspect. I understand how to get the ghosts to move along a deterministic path of waypoints. However, I'm wondering how to code it so that it follows this path while patrolling, but then if the Pacman object gets within a certain radius of a ghost while its patrolling, that ghost begins chasing the Pacman directly. How would you suggest doing this? Any help appreciated! Thanks!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612100827im_/https://answers.unity.com/themes/thub/images/avi.jpg)