I have recorded a short video to show you what I am trying to detect. I am making a very simple pathfinding system for my top down shooter.
When the enemy gets stuck above the player like shown in this video, what is a simple way for my code to detect that? I have tried to compare their X positions but that it is not accurate enough.
Seems to me like your main problem is that the pathfinding isn’t properly detecting your obstacles as obstacles. As you point out as well it is very simple, I would recommend learning about A* Algorithm for example in order to deal with this issue. Yes it would take a bit more time to implement, but trust me the results will be much better, I think you’ve gone too simple for what you’re trying to do.