Download

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.
forum 1.PNG
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 successfulforum.PNG

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
forum.PNG

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:
dcce2cb12ca17649bc37a10cc44e0aa2af8f71ac.png
1751cdecef289fc215f7964228026ea6e7d4de1d.png
54ddb746ca6af78ba4bc700c3b79efb02c1fb6c7.png

And the functions i created:
function1.PNG
function2.PNG

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

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 :’(

Why not just use the get distance to bp node ?

https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/Transformation/GetDistanceTo/index.html

It returns a float value of distance between two actors then simply have a branch if distance is less than whatever value you want then call a function to stop the player/Ai or whatever