How can i stop my character when it is in attack range like league of legends combat?

What i want to do is when the player clicks an enemy he will move in it’s direction but he will stop when it is in attack range(similar to the attack system from League of Legends).
So far i tried to get the location of the enemy, subtract with the attack range, then i made a new Vector with the result and used a Simple move to location function to move the player, but that didn’t work because it will always move the player to the same vector.


Then i tried to do something with the Get Direction Vector function but i had no idea what i was doing lol.
Any ideas?

You could use the “AI move to” node, that has an acceptance radius input, could be what you’re looking for

Just thinking off the top of my head, I would try running off a tick or a function timer looping .01, then use get distance to node and if distance is less than or equal to attack range, clear timer and attack.

Make a shpere volume around your character with a radius equal to the attack range. Whenever an attack command is issued, run a check to see of the target is overlapping. If not, run anAI move to command to the targets current location that terminates early if the range sphere overlaps with the target.

Where is you Behaviours tree?

It does seem like it is the best way to do what i want, i tried to use it but the character just doesn’t move even though it is printing the “Moving” string i attached for when the AI Move to is successful

Since i couldn’t figure out how to use “AI Move to”, i implemented your idea i used 3 custom events calling each other with timers:



And the functions i created:


I don’t have any yet, is that a big deal?

As i explained to Bankworthy before, i am having difficulties on using the “AI Move to” node.

Did you bake a navmesh? I remember wasting an hour this one time trying to figure out why my AI wont move only to realize i forgot to add the navmesh. Lol

Unfortunately I did :cry: