Launching Actors by traits as player?

Hello there,

I have 2 questions concerning the launching of enemies.

Some Context:
In my game the player has a 3-hit Combo. The third hit launches an enemy.

my enemies can do the same with specific attacks. The enemies code works as intended.

Heres the player Launchcode:

I have 2 Problems specificly:
1: This code does sadly not work. “Cast to” never gets called. (Guard_BP is my base for every enemy) I also tried copying the Launchcode from my enemy, which sadly also didnt work.
Heres the code from Gurard_BP for reference:

2: This code can only launch this specific actor/Blueprint Class. But of course I have multiple enemies in my game.

Is there a way in a Blueprint to tell the Player to launch other actors with similar traits/Classes (for Example: Tags) or is there a way to group these actors that they can then be called in the blueprint?

youd want an interface, but you said your cast isnt even being called?

add some print strings on all the fail conditions to see why, youve got a few places it could fail with no branch, ie was nothing overlapped or did the sphere trace hit?

the sphere trace works and gets called everytime. All the forward vectors are also being called and calculated.

However when it reaches “Cast to Guard_BP” the cast always fails (The Output “Cast failed” always applies), even if the sphere overlaps with this Actor(“Guard_BP”).

Therefore the Blueprint cannot cast the “Launch Character”-Node to “Guard_BP” and as such, the player cannot launch the actor.

Thats pretty much the whole Dilemma.

Is there another way to do this while also being able to call other actors/enemies that are also overlapping with the sphere trace?

yes thats what an interface is for, create an interface event called launch character, pass in the vector. run the launch function off the interface now any actor that has this interface will work and if they dont itll be ignored

Sorry for not replying for so long.

IRL Stuff got in the way.

I integrated the interface and it works. Thanks.

I also found another issue with my enemy not recognising “Cast to” which boiled down to having some wrong collision settings (That was fun to find out)…

Its all fixed now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.