Third Person Combat System: Jump to any enemy and attack.

1K2toO
Hey guys, I am trying to recreate a similar system in my game- however, mine is a little different. When you get to a certain distance from an enemy, the enemy will be highlighted and you will jump or teleport to that enemy and attack them. (not in their position but in front of them so that the attack will never miss)

I was thinking about slowing the time and doing a launch function but it doesn’t look very smooth and it doesn’t always work as the sword misses or the jump is not far enough.

Thanks :slight_smile:

You could do a lerp function instead to remove the dependencies on physics with the launch function. Try out a timeline with a float track. I usually make it a time of 1 second with a value between 0 and 1 for lerps. If you want any type of easing, you could make this graph between 0 and 1 however you want. Then you plug this timeline into the lerp function that lerps the players position from it’s start location to final destination.

If you want it shorter than 1 second, I suggest that you set the play time of the timeline before executing it to 1/seconds instead of chaining the actual timeline time. This allows you to change the value at any time, even in game.

1 Like

Thank you so much, I will try to implement that! Hopefully it works

1 Like