How is this pathfinding system made?

Any idea on how i could make this pathfinding system with grids? I don’t even know if this is possible i thought pathfinding only works on characters?

2 Likes

Look into pathfinding on roblox

Edit: i am actually very confused as to what your trying to ask lol

I know about it and been scripting for years now, i’m just wondering if u could make this with parts.

Do you mind providing a clip of what your trying to do?

I think you just want to highlight the waypoints.

2 Likes

I just wanna know how this is done

1 Like

Try pathfind - > Find waypoints → highlight waypoints

How is it squared tho, would i use incrementing (snapping) for this?

eg: math.floor(Position.X / 4) * 4

I think you should try your luck with rounding numbers

It’s not too easy to make, you should check this link if you want to know how it works: Heap (data structure) - Wikipedia

Also here’s a video to see it better (@IDontWantToBuild made it) :

2 Likes

Another alternative is to get all the Positions of points on a grid and find the point closest to the waypoint using magnitude and highlighting it

Yeah that was what i was thinking i should do, build premade grids, update pathfinding then use magnitude to find the closest grid to that waypoint and highlight.

2 Likes

Thank you so much i’m gonna take a look at this and come back to you, but do you know how i could implement it into roblox, i see pathfinding in the output which makes sense.

I have almost no experience for pathfinding so listen to @Sarchyx lol

1 Like

I’ll try to write up a script for grids.

1 Like

I’m not too experienced on this type of pathfind (btw it doesn’t use the Roblox Pathfind service), but this calculates the closest part to the part that is currently the color on (the color is just to visualize it) on an specific grid.

I actually think you’re looking for a graph searching algorithm, like A*? Using a grid map–it’s usually trivial to implement. Also, a heap is just a data structure that you might find commonly being used alongside a pathfinding algorithm like A* (it’s used for other things).

Oh, so for example so it finds the closest part to that grid using math.min and magnitudes and so on, i’m not sure still.

In the vid you sent it fills the corners so we might want to consider a function that does that also.

1 Like

is this possible in lua, i’m still not sure if the pathfinding system is custom or roblox system based.