How do I …
Use the Pathfinding Algorithm but only for one “Step” in my Gridbased Setup where Player and Enemies move turn by turn
Situation …
I have a player (white sprite, pixelperfect grid movement), and two enemies (yellow and red sprite, using pathfinding, virtual grid data = player movement data) and obstacles (pink sprite, pathfinding obstacle). After the Player moves, the Enemy Action / Move should be triggered. Everything “works” fine regarding Pathfinding and the enemy(ies) move to the Player avoiding Obstacles perfectly on the right path.
But of course, the enemy(ies) move to the player in one smooth event. I couldn’t find any approach how to get the Pathfinding “Next Node” or “Next Step” to just let them move one Correct Move of the constant Distance. I tried to add PixelPerfectmovement and do it like I do with the player (Chaning the state after a movement has happened) but it is one smooth movement without any chance to interrupt. I also tried to meassure the moved distance and stop it. But this approach doesn’t seem right.
Any ideas, links, examples? Thanks in advance