I know, I make of the transmission of thought!
More seriously, this is a track to dig among one of others, but as I always look for the easiest way to implement …
Xierra
I know, I make of the transmission of thought!
More seriously, this is a track to dig among one of others, but as I always look for the easiest way to implement …
Xierra
I think Keith’s got this one covered!
I wouldn’t want to muddy the waters here by suggesting 4 separate threads of logic, with one relating to x y and distance and another relating to an invisible trail of objects left by the player and the third relating to invisible objects fired diagonally from the player that bounce off walls and the final one being pathfinding. And then switching between the four of them based on a algorithm that examines all to the player variables and progress.
I’m going to post what I kind of have I tried adding snap to grid which semi worked but I’m still not sure how to get the spacing to go one grid space at a time maybe adding a timer but still worried about the weird jitter I get. I’ll post some screen shots. I’m not nessarily going for turned based (I go they go) but still like the sliding from space to space. Feel really close though
So two things I would like to get from here is - Moving one tile at a time per click or if its an enemy moving to a location sliding across one tile then another then another spaced out. Then fix the jitters and making sure its going on the correct path. It seems to work once in awhile per click moving one grid space over but seems to jump over multiple in weird occurrence’s.
I’m still a little confused. I added to the confusion early and i apologies for that - i was just being silly.
In the giff you select a wall square and it goes up but then you would use the condition point cursor inside floor to prevent this. I think you need to highlight the allowed moves. If you use repeat for each floor and then use point inside object (the points that are central to the blocks surrounding the player) - turn them a different colour and then cursor is inside floor as a condition to highlight that square and move. You could hide the player pathfinding object and move the player to the selected floor square with a tween so that it removes any pathfinding jitters.
I’ll give that a go and maybe look into pathfinding a bit more feels like it’s just right there and still kind of out of reach.
I played around some more. I used a player and target object. The pathfinder behavior works best when the origin and center point are both in the center. Both objects were 32x32
The pathfinder grid was setup to match it. 32,32 and an offset of 16 and 16.that centers the objects in the middle of the grid. I set it to allow diagonals bc that looks more natural.
Here are my events. I split the formula up just to make it easier to read and debug.
This seemed to work although I didn’t test it with obstacles. It helps if the obstacles are also aligned to a grid. As always, it’s always wise to check if a path was found and add something to handle failures.
See this post for more about aligning things to a grid.
https://forum.gdevelop.io/t/how-to-make-sprite-automatic-move-perfect-in-pixel/63812/4?u=keith_1357
I’m gonna throw this code in play around with some obstacles and other things and test it out, again I really appreciate all your help thank you!
Okay so its super close I found one last issue it is great around obstacles but there’s one last issue (I think) The player when directly off to the right/left or top/bottom a few grid spaces away each click it only goes up or down.

ALSO thank you so so so much for all the help I really appreciate it!
It could be a rounding issue or something . IDK. Can you post a screenshot of your implementation. Events.
I would add a text object or two and display stats like angle, maybe the X, Y of the start and the destination. See if there’s something causing it to get stuck in a sort of loop without moving forward.
Are the object origins and centers, centered. It helps if you target the center and move from the center.
Are both objects snapping to the same grid? Are they both on the same latey?
I’m gonna add some screen shots and add some display stats then post them here!


Not sure why but it worked fine when I fixed the offsets and now i did some testing with the recording software and it jumps around like the above so heres one where its just how it usually is where it gets stuck bouncing back and forth with the displayed numbers.

Your events seem to be identical to mine.
Are your object points centered? Are you allowing diagonal movement?
My player behavior
I using the draw pathfinder extension
My events, both objects are dragable, I snap my target object when dropped.
I added a tiledsprite with a repeating grid image.
My scene at runtime.
I looked at all my stuff and it seems to be the same I’m gonna post some more screen shots of the players points and things like that, but you said yours seems to be working just fine?