How to apply damage to a player?

Hey I discovered in blueprints an apply damage “variable” and I was wondering how you would make it apply damage to the player because when I click select asset there is nothing there.
Thanks, I bet it’s super easy and I’m just stupid,
Adam.

Hi Adam,

Take a look at the Blueprint example below on how to apply damage.

The variable “Health” can be used for your player and as a condition for when to determine death.

-W

Thanks!!!

Hi Wes, I have something similar set up but it won’t seem to work.

I made a rocket that blows up and does damage. I then made an object (base) that you can destroy with said rockets without issues. So they are doing radial damage.

I want to be able to do self damage with the rockets but I just can’t see to get it to work. The “Any Damage” event never even fires off.

I have some other nodes in there drawing text for testing, but I’ve yet to even get that far it seems.

I don’t have network play set up yet so I can’t test it on other pawns.

Any Ideas?

Howdy,

First thing I’d check is to make sure that the character has Generate Hit Events enabled, does your character have this enabled already?

-W

It should be, Both of these are enabled. For what it’s worth I have a working pickup object going off of collision as well.

Edit: Found something else out, The radial damage from my rockets seems very buggy. I put the radius way up (2000) and spammed the wall behind my base orb thing I got going on. only every once in a while will it hit and do damage. I then created a pain causing volume and made it hurt 10 when you enter and it ticks for 1 every second or so. I also have health items around the map working fine.

So the real issue seems to be the radial damage not triggering the players damage events.

Hmm. Have you tried taking a look at this example on how to implement it:

-W

Sorry for the delay. I did see that a while ago and did not have much luck with it. Just to test I set my rocket up the same way the barrel is with no luck.

To test something else out I slowed down the rocket so I could run into it myself and set it to do point damage to the hit actor rather than radial damage. This worked right away without issues.

Radial damage just dose not seem to apply to my character actor.

Hi,

As for the character not taking radial damage, can you make sure at least one component (preferably the mesh) in your character actor blocks the Visibility Collision Channel? The radial damage node specifically states that it will only damage ‘visible’ actors, but for some reason the default presets of ‘Pawn’ and ‘CharacterMesh’ that the default character components use both ignore that channel, which might be the source of your problem.

Kind regards,

Thanks for assisting,
It was not enabled, but flagging it did not seem to help much
This is what I currently have going on with my collision.

Let me know if you need any other information to try and see what might be going on here.

I was having the same issue where the player would not receive any radial damage. I was following the explosive barrel tutorial. You do have to set the visibility channel in the character to block. Then everything worked fine.

In case anyone else was having this problem, here’s how to set the visibility channel to block:

  1. Go to your character blueprint and click on components (it is between Defaults and Graph near the top right).
  2. Click on either the collision component or the mesh.
  3. Look at the details panel and scroll down to Collision.
  4. Under Collision, click on the little tab next to Collision Presets. This will tell you what is Ignored, Overlapped, or Blocked. The Visibility channel should be blocked.
  5. Select Object Type and choose Custom. This will keep what was originally there, but allow you to change specific collision channels.
  6. Look for Visibility, and make sure Block is checked.

This solved my problem while following the explosive barrel tutorial.

UE4 - Blueprint Explosive Barrel #1 - Basic Setup - YouTube