How would you recommend I go about implementing the attenuation for the damage? I have created a spherical pain volume instead, as I don’t think cylindrical will do what I need it to.
Cast the actor that the any damage event returns to a pain causing volume get the brush component then use the use the radius (from the get component bounds node) to divide the distance between your character and the location of the pain causing volume by it then do a 1- x to the value. This returns a number between 0 and 1 which you can then multiply your damage if you dont want linear attenuation then feed the value into a float-curve representing your attenuation.
Hey guys, I am having a bit of an idiot moment, and I can’t seem to conceptualize a method of applying constant damage based on proximity.
I have a constant line trace to the player controller to see if there is any obstructions. As obviously I don’t want the player to be dead if they are not stood in area that is not lit.
The above image shows roughly what I’m trying to achieve. When the player steps within the radius of the light, it applies damage, that will increase the closer the player gets to to the source. I couldn’t figure out a way of finding the lit area circled, so I am doing that by eye at the minute, and have set it so there is no damage past a distance of 450.
And this is where I am stuck. I am sure there is probably an easier way to do this that does not involve the next level equations I have been trying to formulate… So I am putting this question to you wonderful bunch!
There is a pain causing volume that triggers the any damage event in your player controller that can use a cylindrical shape. Out of the damage event you can get its location and then attenuate the damage based on the distance to your player.