Playing a Hit and a Miss Sound

So let’s say my character throws punches, and when I reach a certain point of the animation (through an Anim Notify) I want a sound to play, if he hasn’t hit an enemy, a whiff sound, if he hits an enemy, a hit sound, sounds simple right?

The problem arises on where to put this logic, when I reach a certain part of the animation, I activate the left hand (or right hand, depending on the animation), after that, I check to see if it’s overlapping the enemy, if it is, then I activate a variable which is then verified to see if it’s on, if it’s on, it should play the hit sound, if not, the whiff sound.

The problem is that this bring a load of collision and sound problems, because sometimes it registers a hit, and sometimes it doesn’t, as seen below.



Right Hand Not Working - soundcollsion - YouTube
Collision Problem - whiff - YouTube

The solution I had before this was playing the sound on the enemy’s BP (because there I can be sure it was hit), but the problem would be that both the whiff sound and the hit sound would play at the same time, and that defeats the purpose of what I want to do.

Could anyone help me out please? I’ve had my head on this one for awhile now.

Most likely your issue is that both hands overlap set a single bool. There’s a lot of character bobbing and close proximity that I’m sure each hand is playing tug-of-war with that variable. Try setting a separate punch bool for each hand.

You could also have an issue with setting the collision on the fly. If the anim notify triggers after the overlap event would fire, maybe it isn’t setting the punch bool to begin with. You could try to set punch bools on overlap/end overlap constantly, and just check what state it’s in on the anim notify.

Yeah, I agree with Obsidiaguy–chances are it has to do with your validation of a successful impact or not.

You will want to ensure validation with both the overlapping objects (player fists and impact meshes) and ensure that data is clarified when triggering the resulting events.

Yep, verifying the variable in the Anim BP gives much better results, thank you.