Where to put damage in BP for enemy and player?

I know the basic to Apply Damage to enemy but there ‘each attack pattern I create’.

  • I create Light Attack and Heavy Attack

  • Every video tutorial I watch have I only that mostly 1 attack.

Here the BP below

Where to put Apply Damage?

Did you already set up the “Apply Damage”?

Event any Damage is just an event for the Character which is receiving damage. So you can set it up within the Character BP

Do you mean simple Apply Damage? No need to connect to other nodes?
Sorry I just newbie of this BP.

Apply Damage handles the damage you do with your attacks.

Event Any Damage handles the incoming damage.

In your case, just try on the end of your attacks to apply damage (you can create a float variable to [instance editable & expose on spawn] to have quick access). In the blueprint of the character which is receiving the damage, you write the Event Any Damage. I prefer to create something like an “Base Character”. Within this Character all Stats, Damage and main Character things are set. From this Base Character I create an Player Base and an AI Base. (within these 2 I write the specific code for player characters and AI characters)

Anyway: with this method, it’s easy to set up an damage system and share values between AI and Players.

is there a tutorial or sample blueprint?

I still have not started yet but is there specific damage to put?
For example:-
-Light attacks receive small damage
-Heavy attacks receive big damage
-I also have a weapon blueprint and the inside is empty

update…still not working :smiling_face_with_tear:

this character ai or enemy dummy

this weapon

hope someone points out what I did wrong

On Event Any Damage:
You dont need to cast here. the causer is set whithin the apply damage

On Compoinent Begin Overlap:

  1. Base damage is 0. You can create a variable within your SpearBP and connect it to the damage. (so it is easier to modify)

  2. You are already within the SpearBP - the one which is dealing damage. So you connect “Self” to the Damage Causer

  3. Damage Type Class is empty - default would be “Damage Type”

it does work but the animation didn’t play…

Can you share an screenshot of the montage?

I didn’t change that much, it same as the previous picture but I zoom in to look for details.

That’s your AI Character. I meant a screenshot of the Montage :slight_smile:

Just open it, pause and make a screenshot

sorry about that

Thanks for that. But I meant something like that:

Since you are using a combo, I assume that you are using different animations within the montage? If it is so, there are a few settings to set.

The other thing is the damage:

  1. How should the damage be applied? (e.g. Hit Box Collision)
  2. When should the damage be applied? (at which point of the single animations within your montage - e.g. it shouldnt be at the beginning. That would look weird)

so that montage means. I thought it was a video.
Sorry about that

here the characther AI montage

here is the combat character. Every montage is same

No problem. We are here to learn :slight_smile:

Basically your code works correctly (you can see it at the video - the character does the animation of the montage and the print strings are showing their content)

What do you try to achive?
(I assume the damage system is now working correctly)

(I assume the damage system is now working correctly)

Yes, the damage system is work but it does not animate every time it hit.
When the weapon hit the enemy, the enemy not show the animation just stands there. That’s the problem.
Now I still try to look at other tutorials, but mostly does not work and I don’t know why?

Ok so you mean the hit reaction of the enemy and not the attacking animation of the player?

yes, hit reaction of the enemy.

The first thing to think about is the detection of an hit. E.g. Hit Box collision or sphere collision which will be drawn in front of the character at an specific point of the animation. Do you have such an system implemented?

I already put the collision in enemy