Problem is that, when I exit the box while the fire is still on, and I re-enter the collision box, the health doesn’t decrease, I need to get the bool values of enable input and activate, branch them to see if both of them are 1 or true, and after that, deplete the health, but I have no clue how to compare the bool values from them.
I’m trying to convert the script to using the damage functions such as ApplyDamage but I’m still in need to check both values for positives.
Another, thing. Can I somehow change the increment values only BP wise, because if I double click the increment value set it to 0.1 it changes on all of my BP. I wan’t to have various damage values for different BP.
I don’t use ticks, as I’ve heard they can be FPS restricted.
I just need a way to compare if the activate fire, and overlap box are true at the same time.
Helpful answer btw.
It’s probably better to have all the inputs in the same blueprint, like the PlayerController class, instead of having the input events directly on the bush. From there, you either grab a reference for the bush with GetAllActorsOfClass or GetAllActorsWithTag to set a bool variable in the bush.
On the bush itself, it’s just a question of setting the bools and proceed to the health decreasing code. As an alternative, you can also use a looping timer for the decreasing health
Also, the Timeline loop seems odd, when finished, you always just restart the timeline again, is this correct? I don’t think that Stop calls the Finished function on timelines so you should be okay there anyway.
Use variables in your code. For e.g., you might want to have a IsOnFire bool variable and a DamagePerSecond float variable in your trigger. On activation / deactivation just set the IsOnFire bool variable in the trigger
Then in the tick function of the trigger, grab all the overlapping actors and send damage events (if IsOnFire is true). The damage you send per tick would be DamagePerSecond multipled by the DeltaTime you get from the Tick event
If you want to customize the damage per instance, make the DamagePerSecond variable public (by clicking the eye icon next to the variable name in the list)
Ok then. from your blueprint just replace the Enable and Disable Input with a new bool variable. On your input events, branch to check that bool, and then if true, activate or deactivate it.
Also, select the Z and X key events and in the Details tab, make sure Consume Input is checked. I think it might work that way.
Edit: this is just to turn the light on. But the radius to turn on the fire isn’t the same as the radius to burn the player is it? So, I think you have to add another trigger, a smaller one, to start and stop the timeline
Edit: https://imgur.com/a/Xg3dd
This fixed my problem, now when I reenter the health depletes again, but the fire doesn’t need to be on to burn me. Ahh the magic of coding, fix something to break something else
Yes, you have to check if it’s active when the player steps on it. Here’s my solution with 2 triggers and a timer, one to activate the fire, and another to burn the player, in case anyone needs it too