No movement melee hit

im not sure how to even search for this concept but i have my player standing still and swinging their weapon/shooting their spells. i want the attacks to hit but just calculate damage based on stats and weapon damage, do i still need collision boxes? how do i also add auto attacks that can be sped up based on stats?

anything would help immensely, thank you!

i thought as much but i wanted to confirm before i clutter up my code, thank you!!!

Well you don’t necessarily need collision boxes for the weapons or spells themselves as such, but you do need a way to tell the enemy that they have been hurt and the simplest way to do that is collision boxes or line traces. Potentially sphere trace for aoe. The idea is that you enable the collision through an animation notify and any enemy that has their capsule overlapped can receive damage. For line trace you’d just send it directly to an array of hit actors but it’s the same basic principle.

As for looping the attacks that’s fairly simple, the basic methods are either a string of animations/anim montages or using animation sequencing where you just loop the code back to the beginning or you could even loop the animation itself, it’s pretty simple.

Lots of tutorials out there for stuff like this!

No problem. To prevent the player from moving while attacking the easiest way is to make a boolean variable, call it “IsAttacking” or something to make it easy to recognize, and add a branch to the movement input. When that variable is true, do not allow the function to continue.

You set that variable to true when the player presses the button to start attacking. When he is no longer attacking you set it to false and the player can move again.