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
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)…