whats the Correct way to add movement to melee attacks.

i want to add elden ring type movement to my melee attacks. eg lets assume our melee attack montage has root motion of 400 distance. if we attack and there is no enemy nearby to attack or no enemy in range than we move full distance that is 400. but if there is a enemy nearby whos just 200 distance away from us then we dont move full 400 distance we move only 200. i tried to create this using the motion warping plugin but in i cant use different distance for each animation. (eg i want different distance for each attack combo in each weapon). the workaround to get different distance on each animation would be to use different “wrap target name” for every animation. but i dont think this is correct as it will create lot of mess. is there any other way i can create? and if this can be created using motion warping how? is there any other way besides motion warping?

It sounds like you’d want to use the “get forward vector” and “add/set velocity” nodes to accomplish this, combined with a collision check to null velocity if they if they collide with an enemy