I am making a pacman game and the last thing I need to figure out is the code for random ghost movement. Everything else is done except the ghost movement. I don’t care about each ghost having different algorithms. I just want them to move on their own within the maze. The ghost is a pathfinding object and my maze is the obstacle. I am trying to check if the ghost is stopped when it hits the obstacle. But the “if ghost stopped” condition does not work. I tried using “if ghost speed = 0” and that did not work. How can I check if the ghost is stopped so I can raycast the available directions the ghost would be allowed to travel?
Also, I like to put messages on the screen so I can see and test the values of my objects, but I can’t figure out how to display the ghost speed in a text object on the screen. I want to see the built in values of an object and not just my object variables. Any help would be appreciated.