As it stands, the flashlight can not be switched on when the battery is below the minimum charge level, but neither can it be switched off when it is already on. Any ideas how to go about achieving the first part, without the second happening? I’ve tried using a branch on only the A output of the Flipflop node, but then it only ignores the first time the button is pressed, but the second press turns the flashlight on, because the second press activates the B output, and thus bypasses the branch. So that didn’t work.
Yeah I figured it out eventually… Was not that complicated actually.
First I got rid of the FlipFlop when I figured out I didn’t need it. It was also causing problems with this aspect of the blueprint, as it switches every time you press the button, whether or not the flashlight could react to the first button press. Secondly I added a node to check the visibility of the flashlight object as a second condition for the flashlight to be toggled. Now it works like it should. You can turn it off when the remaining power is below the threshold, but only turn it on again when the remaining power is above the threshold.
your blueprint seems to be much larger than mine. hmm but i see how your method would work i will still upload my method (video) just in case anyone who is looking for a different method
Thanks for throwing that tutorial together mate! Nice to have people like you helping the rest of us. Mine recharges over time as well, which adds another branch. I also have some delays in there to control the discharge and recharge speeds. Makes it easier to adjust when play-testing. And then where you have the press G thing to recharge, I have pickups. But that part doesn’t show in the above blueprints. One thing I probably should mention is that I created a flashlight input in the project’s input settings which is mapped to F by default, but can easily be changed without heading into the blueprints.
yh i noticed that you put a input in for it, and i thought about doing the tutorial that way but not a lot of people know about the input settings so i thought i try and keep it simple