How to use Pain Causing Volume to damage player
I want to use the pre-made Pain Causing Volumes to damage the player instead of making something similar with code. I'm new to coding with UE4, but I'm sure it's something simple.
asked Oct 14 '15 at 05:24 PM in C++ Programming
The easiest way to do this would be to use the ReceiveAnyDamage function from the AActor class on your character. This function is called whenever any type of "damage" is dealt to your character. Whenever you step into a Pain Causing Volume, it causes "damage" to your player for the amount that you have set and for the damage type set. If you step into a Pain Causing Volume, any code that you've put into your overridden ReceiveAnyDamage function will be called, which you can use to decrease your health by the value that is passed into the function by the Pain Causing Volume. You can find more about this function's declaration here:
Hope this helps!
answered Oct 20 '15 at 08:21 PM
Matthew J ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here