Let AI jump to specific location (Players Camera)

Hi all,

I currently stuck with a problem in my AI solution. I want the AI to be able to jump at the players face (player camera location). I’ve managed to get the correct location where the enemy should jump at. But I actually stuck with setting the target location for the jump. Surprisingly I wasn’t able to find a tutorial on that topic.

Using the Jump function from the Character Movement component can give a similar feeling, but does only work if the AI is in movement. But I want the AI to approach the player, then wait to prepare for the jump and then it should actually jump at the player.

Any suggestions how that is achievable? Maybe something like adding an Impulse, or lerping between the positions. But I think that would look really bad, since it wouldn’t take gravity in consideration.

Any help would be really appreciated.

Hey guys,

never mind I’ve found a solution that’s working. The magic word is “Launch Character”.

My solution works like this (it’s not perfect but good enough for me):

I get the actor location for the controlled pawn and subtract from that the attack location (in my case the players camera location). After that I’ve multiplied this vector with a float value I’ve liked. Then I’ve plugged this result into the Launch Velocity of the Launch Character node. Target is output of the Cast to Character (or in other words the AI character).

Hope someday that will help someone.

Cheers

1 Like

Just did.

1 Like