I'm having some problems with "Launch Character" function, please help!

Hi there, I’m on my journey to create my own game, and I have some ideas about knocking back an enemy whenever I hit them. But there was a problem.

Whenever my enemy is standing still, not in an idle state but standing still (i disabled the AI functions), the Launch Character is working as intended and launches the character.

As you can see the slime is launching as I successfully hit him.
But when I set it to wandering around, basic AI systems, attack when he sees me, whenever I hit him, he doesnt get launched away x and y axis, only z axis.

I tried to turn on XYoverride and even Zoverride but nothing seems to work. He will launch by Z axis despite all my settings.

Here is my settings for the launch Character blueprint in the child AI slime:

Here is parent AI bp:

  • Wandering state:

  • Chase state and deal damage to the player when it hits and launch the player, This works OK (I tried to gather every node in one picture so you can easily capture the whole):

Thank you for reading! If you have any recommendations, feel free to guide me! I have tried to do this launch function in the player action’s BP or anywhere in the blueprint, and they are giving the same result!

Hey @VNBlidion how are you??

I think the states of the Slime AI are “correcting” the position for X and Y and that’s the reason why you only see the “Launch Movement” on Z axis.

To avoid this issue, you can add a new state to the AI called, for example, “Knockback” and move the slime to that state when corresponding. Removing it from any other state and avoiding that XY correction.
You should do it in this order:

  1. When the slime receives damage, change its state to “Knockback”
  2. Disable all AI movement when the slime is in “Knockback” state
  3. Apply the “Launch Character”
  4. After the knockback is completed, return the Slime to its previous state

In this way, the slime should be pushed as when you test it with the AI disabled!

Please, let me know if this worked or if you need more help!

1 Like

Hi there BRGJuanCruzMK. Thank you so much for responding!

Omg thank you so much, I did everything you recommended and it works! And I also figured out that changing the slime state to “falling” also works!

Thank you very much!

1 Like