I'm trying to make health reduce while interacting with an object. I'm using Unreal Engine Blueprint. I want it so as soon as you interact with the object your health goes down, but once you stop interacting your health stops reducing.
I'm trying to make health reduce while interacting with an object. I'm using Unreal Engine Blueprint. I want it so as soon as you interact with the object your health goes down, but once you stop interacting your health stops reducing.
I would do this in three parts:
This way if something other than the player comes in contact with the object, it's ignored, but when the player makes contact it starts repeatedly dealing damage until the player ends contact.
make private bool variable in the class. set it to true when begin overlap. set it to false when end overlap.
in Tick function reduce health when variable is true.
to be very simple...
fallow cpp way and make changes as in Tick function like the person above said ...
make private bool variable in the class. set it to true when begin overlap. set it to false when end overlap.
in Tick function reduce health when variable is true.