Right now I have my player shooting two different enemies. I take the break hit result “hit actor” and sequence it to cast to both enemy BP’s.
How do I do this with choosing to only do the correct one?
Right now I have my player shooting two different enemies. I take the break hit result “hit actor” and sequence it to cast to both enemy BP’s.
How do I do this with choosing to only do the correct one?
Yor can use the CastFailed as @ClockworkOcean said. But you could also “get actor class” (this a normal BP node) and when you have actor class you can check for specific class with equal check “=” and put the result True/False into a branch. If false, do the same check for the next class.
Your could also make an enum with all your classes names to make a switch on class name enum and so you have an output for every class name. If you need it often to check for classes names with the same classes this could make sense.
If “cast” or “check classes equal name” is faster is a topic of the following discussion. But without a fixed result. I question their but till now no UE4 super guru said a definitive result on the questions:
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1635702-casting-vs-class-equal-to/page2
thanks guys, its working perfectly
Nice to know its working. Please upvote one of the answers.
Just one remark: are you using interfaces? I ask this because of the Damageinter node. If so, then you do realize you are calling it wrong, right? Not only you’re casting but also the node is wrong. You should call the Damageinter that has a small enveloppe in the corner.