I am trying to do damage with a weapon wielded by the player character. My target has a collision capsule which surrounds it completely and has Collision set to “Pawn”.
My weapon has a collision capsule attached to it and it has Collision set to “Overlap All”. I made both capsules visible in the play viewport to verify that the sword is indeed passing through the target.
This is the damage part of the blueprint:
I print the length of the Overlapping Actors array to see if it hits anything or not, there is only one enemy spawned on the map so length = 1 means it hits the target, length 0 means it doesn’t. The 3 pins connecting to Play Anim Montage are from my 3 different attack animations, I’ve set the attack to play in sequence, so attack1 followed by attack2 then attack3. The result when I run it is 100100100100 which means only the first attack is getting a result from Get Overlapping Actors and the other 2 get zero.
To verify that my capsules are set properly and my attacks are also set properly I swapped around my animations and no matter the order of the attacks, only the very first 1 will register and deal damage (Length of Overlapping Actors = 1) while all the others will result in length of 0 and do no damage at all.
What am I doing wrong here?
As a possible solution to my problem I started playing with Begin Overlap:
I set the opponent’s mesh collision to “Overlap All” and now all 3 attacks damage it, however they also damage me.