Sword Collision onHit/onOverlap

I hope this is in the right place, wasn’t sure where to really put it. I’ve searched for this and not got much back but if I’ve missed something i’m sorry

OK so I have a question, I’m looking for the direction of either a good tutorial or if someone wouldn’t mind explaining here. I’m looking on how to sort out simple sword collision and damage. I have created a sword blueprint adding a simple box collider over the blade of the sword. This was then attached to the character model through a socket. I have this working and I also have the animations to make the sword swing etc.

What I am looking for is the next bit. Getting the simple collision/hit to work to be able to register the hit with the enemy and then to have them take damage. In turning off the swords collision I managed to get the character to be able to walk forward without colliding with the sword in his hand, but i’m not sure what is the best solution. I tried a onOverlap based solution but i seem to be overlapping something but it doesnt seem to be the enemy. My work around, while returning something that might come close to resembling progress seem very crude and hacky. There seem to be lots of tutorials for guns but not very much for swords.

Any assistance on this would be gratefully received.

Many Thanks

MODs maybe move this to Blueprints… Sorry

Hi.

If you can attach the sword and make it stay in the hand then awesome. 90% is done.
To get your hits go to project settings, collisions and create a new object channel… use this channel on your enemies. Create another one for melee weapons. Set your weapons to this channel.
Then on the overlapping component of the sword… the one that is suppose to fire the event make sure its channel is the weapon channel. And set the custom collisions to only register for your enemies.

This is ideal. However… as a double check you can do an on component overlap event, cast to enemy… then only if the cast was successful do a cause damage node.

1 Like

Cheers, I’ll give it a go when I get home.

I go through this on a video tutorial… Alice in Tokyo Wonderland - Blueprint Only Action Hack n' Slash - Work in Progress - Unreal Engine Forums

you may have to check out the video before it too to get it all working…not sure…it’s been awhile since I made those…

how do i set my weopns to this channal?