Modes: 1 - Follow mouse cursor if it can see it, otherwise wander. 2 - Follow mouse cursor forever. 3 - Wander around forever. Also I forgot to check for impossible locations :P Press "d" to enable/disable debug, only hides variables Press "space" when the project is stopped to pathfind from 0,0 to any location Press "b" to I guess set a wander location, idrk :| Node Dist is just the distance it travels between the points on the path when calculating for a path. Oh and wall detection means if the wandering will find a spot through walls or not.
This is my original pathfinding algorithm, meant to run fast and well on Scratch. This will soon be implemented in a tutorial that will be posted on my YouTube. If you do not understand how it works, than do not worry; you are not alone, even I barely understand. - Just under 600 blocks - Everything is by me - Works in any game with a level Q & A: Q - Where is the tutorial? A - Coming soon on my YT (as in a couple of weeks), name: FunnyFlame. Q - What is all the color stuff? A - It is mainly meant for debugging, it is pretty much the path being made, if you see colors like blue or green, it is just calculating one of the best paths. Q - Can you change the speed? A - Not yet, I plan on adding interpolation, but right now the only way is to just decrease or increase the node distance. Q - Can I use this in my project? A - Yes, it should run well and should not impact performance by much, if you want help adjusting some things, please tell me and I will try to create a version where it works for you. You also do not need to credit me if you do not want to. If you have any other questions you may have, please add them to the comments section. Also it should work fine on any device, but if there is lag, then you can use TurboWarp.