I need help with loops?

As a beginner myself I know it can sometimes be frustrating when you spend a better part of the day trying to do something that in your mind should be easy but then you hit the wall again and again. Don’t give up!

Have a look below. Copy and paste into your editor if you have to but this setup does work, maybe it will help you understand how basics work.

You will need to create a new blueprint class (actor). This will be a simple box collision actor. Name it whatever you want. When you walk into inside the box you will receive damage. You will see what I mean later.

Follow the steps in screenshots and then compile/save, place your actor somewhere in the world and you should get something like this.

Play with scale of the box in the world to make it big enough so it’s easy to walk into, place it next to an object in the world.

Next go into your character blueprint and create some variables, you need 3:

Health (float) - to store your current health value, set default to 1.
TakingDamage? (boolean) - to know if you are taking damage (default false)
RegenUseTime (integer) - this is your clock value (default 0)

I’m using intager for my clock because I’m displaying the countdown on screen too.

This may not be the best setup but I would say it’s new-starter friendly. Of course solutions from @GamerP57 and @Everynone are awesome and way better then mine so you should give them a go too!

You have the solutions here, all you have to do is copy it and play around to better understand what is going on. Have fun! :slight_smile:

277222-variables-character.png