Fixing My Fire Input

Hello, I am trying to set up a working fire system. The player is supposed to be able to switch between human and “human torch” on a single button input.

This is the input to turn it on and off.

This is the event tick to allow it to drain when being used.

But I’ve been having issues trying to keep it working properly. To elaborate, I want it to stop all sound and visual when the fire supply is out. It works when it first runs out but I’m still having issues where when pressing Q, sometime the audio will still play and other errors like that.

If someone could help me set it up to function properly as should, I would be super appreciative.
I can provide all the info required along with more screenshots and even a video if needed.

As far as I can see, you are setting “fire” to true every time you don’t want to see the fire system and hear the sound of the fire playing. Not sure if it resolves your problem, but a thing I would try is to set “fire” to true after the “set visibility” and “stop” in the event tick graph…

@CanesLupes

I’ve tried setting it up as you said and that really didn’t fix it. I feel like this is really simple but I’m just overlooking it or poorly explaining it. The fire visually cuts off and the audio cuts off when it the Fire Supply runs to 0. So that basically works. But let’s say I try to cut the fire off before it reaches 0. The audio will stop but the fire continues being lit. If I press the input again, the audio will start playing. It’s kinda like the audio is mostly controlled by the Q Input. I want it where if fire is on, audio will play for it. If fire is off, audio won’t play. No matter what.

Could it be something to do with that in my Event Tick, I had it all running on fire being off? That would make sense to me but the way it’s set up, I think turning fire on sets it to off with my Q Input. I’m confusing my self a bit just typing it haha.

Ohhh… I get it. Take a look at how the Q input is set up. At the first branch you are checking if you got enough fire supply to light the flame. If this is not the case, you set the fire to be invisible. You don’t really need this part since switching of the flames at low fuel is handled by the event tick graph. At the second branch you handle the behavior if the tank is full, but you want to set if the flames are on or off. So you just have to move the SetVisibility from the false branch of the first to the false branch of the second branch node. (I would provide an image, but for some reason I can’t upload any). I would move the true branch of the first branch node back, to the true branch of the other one. This is not necessary but for readability probably helpful. Also you could think about moving you switching on and off behavior (set particle system visibility, set sound play/stop and set fire Boolean) to custom events, which you call every time you want your fire to be on or off.
One final thing: the way you set this up, your fuel tank for the fire can have negative values… this is countered by setting fire to true as I already suggested Hope this makes sense…

As far as I can tell, this all works now. I really appreciate it.