Creating a radiation zone?

Hello, everyone. So, I am creating a game set during a nuclear meltdown and want to simulate the player being poisoned by radiation.

To do this, I’m using a Pain Causing Volume, but I need the volume to keep damaging the player until they leave the volume. I also need the amount of damage to be randomized to act as a dosage of radiation. Does anybody know how I can do this? Any help I could get on this would be greatly appreciated. Thank you for your time and have a nice day.

I’m looking at the code for PainCausingVolume code and unfortunately you can’t create a BP child and override the functions. You can however do it in C++ and expose it to Blueprints.

Basically it does everything you want except the randomized damage. You’ll just need to implement virtual void CausePainTo(class AActor Other);* in your child class and add your randomized damage logic.

I thought Pain Causing Volumes already continuously damage the player as long as they are in the volume? I think you just have to tell it in the details panel how long you want between damage ticks.

Also, for the “damage” to actually affect the player’s health, you will have to set up a health variable for the player and hook it up to one of the damage events.

To randomize it, you could use the number you type into the pain volume as the minimum damage and then add in a random number on top of that in the damage event. That’s kind of clunky though.