so recently i’ve been working on A* pathfinding but i couldnt find really any tutorials on it. Does anyone know how i can make an A* pathfinding algorithm? Thanks
What’s wrong with using Roblox’s Pathfinding Service?
It only works for roblox’s specific use case of the system. You have more control with your own pathfinding system rather than roblox’s.
This video: A* (A Star) Search Algorithm - Computerphile - YouTube could probably give you some ideas.
hmm i’ll check it out. What language does he show it in?
He doesn’t show any programming, he explains the A* algorithm, it could give you some ideas to implement the algorithm into Roblox.
ohhh alr any videos that program A* algorithm?
Well, any kind of pathfinding algorithm is going to require the use of Dijkstra’s algorithm in some form. You will need to write code to perform a node analysis of the map to create the nodes. That’s a lot of work that Roblox has done for you already.
I am curious about your specific use case though.
This video: ROBLOX Custom Pathfinding Script - YouTube in the description gives the source code. Although it uses deprecated function, it should work.
hmm alr. My use case really is just to test it out and maybe make some cool ai with it or something. Really just wanting to learn.
yeah i saw that video, its jsut that I dont really understand the code that much lol
It essentially uses raycasting and magnitude to find the end. The nodespacing spaces out the nodes so they don’t look all jumbled up.
Ah. Wanting to learn is always a good thing. The most important thing when learning is to have fun.
@10kgoldxdrip The only depriciated function that I saw was workspace:FindPartOnRay() which was replaced with workspace:Raycast(). It’s easy enough to change the code to reflect the new changes.