I’m trying to use the PathfindingService to make an AI that can travel from one place to another. Since the game this is for involves moving obstacles and changing map features, I want to detect when the path that is currently being taken is blocked. My only issue is that the script is receiving the Blocked event when the path hasn’t changed at all and the AI can clearly make it to where it was originally trying to go. Like, if I didn’t detect for the Blocked event at all, the AI would make it to its destination without problem. But since it keeps receiving false Blocked signals, it has to reroute even when it’s not supposed to, and it reroutes constantly and fails to make it to the final destination at all. Is there an issue with the Blocked event or something? I’m honestly stumped here.
Games are nothing but smoke and mirrors, and thus, your programming can be so as well.
You are creating the obstacles, this means that you can give each obstacle a boolvalue, and make them true when it’s blocked, and false when it isn’t.
Then you’ll only need to make the ai check if it should even try to pathfind there.
Heck, it doesn’t even need pathfinding if it’s a linear game like Deathrun if you take this approach.
I suppose you’re right, and I could definitely find a way to manipulate it myself. It is pretty frustrating to me, though, that I’d have to do this, and I’d still like to see if there’s some way to work with the Blocked event.