Sword collision

Hey,

I’ve set up a directional combat system where I can move my mouse in a direction and it’ll launch an animation. I can deal damage and kill NPCs, but I want NPCs / other players to be able to block attacks, and as such I’ll need the sword to collide on a set amount of blueprint actors. I don’t want the sword to stop moving when hitting flesh, but I do want it to stop moving and possibly rebounce a bit when being blocked by another sword or shield. How should I go about doing this? I’ve looked at object collission channels and overlap events, but I’m just scratching my head here. I’m using MultiSphereTraceByChannel in order to register hits. I have looked at pretty much every single melee tutorials and topics, but if I have missed one that you think might be useful, feel free to forward me! :slight_smile:

Summary: I want my player’s sword to be able to collide into a set amount of actors.

Any tips are most welcome!

every single attachment ( sword , shield , helmet) can have a different collision type.

you can check the sword’s hit event or overlap event to see what collision type the hit component have and play different animations based on that.

it is not that hard. you need to play with conditions only.

if hit component is a shield then do …

if hit character is a monster and hit component is a nail then do …

Okay, that’s what I thought, and it sounds doable. Thanks! I play attack animations from my character actor; how would I make the events of the blueprint actor (for example a sword) have an effect on the animation already running? I’m guessing some use of Blendspace etc? Haven’t dived too much into animations yet. :slight_smile: Any specific nodes I should use?

Let’s say the sword hits something at a random range; that random range will change all the time, meaning I can’t have a “static” animation as that would not look realistic. I guess I would use an OverlapEvent to get the position where the colliders are overlapping and then force the animation to change at that spot. Am I thinking right?

search about animation montages.
they enable you to implement that rebounce animation that you want.

something like this

and the next video after that

Thanks, I’ll have a look at that! Appreciate the help. :slight_smile:

Can you pleeeeeaaasse make a tutorial or tell me how you did the directional combat? I wanna do something like this, but am a beginner and found no tutorials at all! Like, can you post your project files or the place from which you learnt it in the first place? Thanks!

Hello!
There’s a bit of information out there, just gotta dig pretty deep to spot it. I looked for a long while in order to get what I needed to make my system. My system is a combination of this tutorial series Unreal Engine 4 - Setting Up the Character (Part 1) - YouTube, and the system showed here: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
If you’re new to UE4 as you say, I strongly recommend following the whole tutorial as it’s solid.

I played a bit around with it, so when you’re done with the above resources come back here and we could jump on discord or something so I can help you. :slight_smile:

OK man! Will definitely try it out today… We can do something together, I guess… Discord is fine. Thanks a ton!
EDIT: I saw the video, and skipped through the series to find what does he do in combat. Seems like there are videos only up to Episode 9, till which he makes things like Inventory System, Skill Trees, etc. I actually don’t want these components in my project, I just want a Health, Stamina bar, and realistic 5 directional sword swinging combat! A single AI for now, as you said before, who can block the attacks and rebound from swords/armors/shields… My idea is heavily influenced by a game called Kingdom Come: Delverance. It’s like kinda slow, real, and involoving physics! Give it a look Kingdom Come: Deliverance – COMBAT Gameplay Tutorial (Sword Fight) - YouTube Please find a way of contacting me on discord… Should I share my tag here?

Thanks a ton!

Very understandable. I aim for the same realism as Kingdom Come. Share your discord here or PM it to me and I’ll get on in the weekend, possibly Saturday.

My Discord is R.Aditya#0040. Talk with you later man!