A* Pathfinding Project

Continuous Click and Navigation



I am quite new on pathfinding. However my navigation works by double click. My question is simple i think but due to I am new, I couldn’t figure out. I am using AIPath, AIDestination Setter, Seeker, Funnel Modifier and Target Mover. What i need is if I hold my mouse button down? It should continuosly navigate to target. How may I achieve this? Thank you



The TargetMover script is just an example script, I would recommend that you write a similar one for your game that fits its needs better. Generally the only thing you need to do is to set the target position every frame while the mouse is pressed (either by moving a transform that the AIDestinationSetter uses or setting the ai.destination property directly if you are not using the AIDestinationSetter component).


Thank you so much sir. I will definitely do it then.