Showing number of times a projectile hits the player

Hello, so I want to make a widget blueprint to appear in my defeat screen when my player dies. i just want to show a number next to for example 3 attacks that the enemy had (for example a missile and a laser). So i would like to show the picture and next to it the number of hits that the enemy attack damaged me (a number for example 3 saying the attack hit the player 3 times) can someone explain to me roughly how to do this? i dont need a full on explanation just a heads up

Hi, you can add an array(size equal to the number of weapons) to the player blueprint and make its default values 0. Then you can add in the blueprint an event that gets a type of weapon(or an integer that corresponds to the type of weapon) and then adds 1 to the array at the spot for that weapon. then whenever he gets hit with a weapon just send to the event. then when he dies the widget can get the information from the player.

ah ok I see. I made an integer variable for each one of my weapons. I dont seem to really understand how to connect everything into an array and where do i connect the array?. also if i want to call the variable from somewher else like level blueprint, where do I connect object. (the gray node at cast to [actor]) showing an example will help me a lot i understand it better sorry

ok. sorry for the confusion. what I meant is to create an array not many variables and putting them together into an array, but if you want you can do it without an array. like this:

if you want to do it with an array it would be like this:

82454-hitbynum.png

this just means that instead of names for each type of weapon you would have a number for each one.

As for calling the event, I don’t know any way to call the event when the event is in the actor but what you can do is put the event and the variables in the player controller, and then it would look something like this:

My player controller is called BPTouchPlayer. so basically what you are doing is getting the controller then casting it to your specific player controller so that you can access your functions and events.(if you want you can make it a function instead of an event)

I see now! thank you so much it worked perfectly haha sorry i had to ask again im not very good at unreal