How to reset score after player died

Hey guys,

I want to make my score i got from killing enemies reset after i was killed by one. Someone know how to do this?

I.E. I kill 2 enemies i got 1000 points. Wehn i get killed i want it to be back at 0 and start the score increment again

Thanks in advance!

When you die, simply set the score variable to 0. Then you start adding from zero when you add the next kill.

Can you show me that how i can do that i a UE Blueprint renderer or how it’s called or explain better. Cus i am quite new to UE

First you have to show me how you handle your scoring in the first place.

Alrighty then here it is Screenshot - 386285e13f51b77fcabefa2086728259 - Gyazo

Screenshot - eebc23e8ccde8ebf56902ff776c3677c - Gyazo more detailed one :slight_smile:

And how do you handle death?

Here it is: Screenshot - 610a543446e85544991b7ef609ad9ed9 - Gyazo

In the twinstick class where you handle score increments, make another event called resetScore. There you simply set the score to 0.
Then in the HeroCharacter class you call that function after you disable the input.

Alright i will try that. You will hear from me if it worked or not (aKa if i got it or not :’) )

Hey me again. So it is just done like this or not? Screenshot - d65ac8463a9a71fde7436c4e8de4c454 - Gyazo

Yes. Just like that.-

Sorry for my noobness again I dont know how to get that event in my HeroCharacter ;/

Where do you call the increment score event then?

I did that in the TwinStickMode Aka Gamemode with other gamemode related things in it

Then just do this. Get the game mode and cast it to your game mode. Then call the function from that. Slot this code into your death handling code you showed me before. http://puu.sh/r5wPE/eb6681bfca.png

And where do i put the cast exactlyy

Can you make a very detailed explannation plss

Here, after disable input: Screenshot - 610a543446e85544991b7ef609ad9ed9 - Gyazo

How does it know it has to cast that resetScore event?