Hello everyone.I have this project with the 90s flashlight and I want the F key to be off until I go into the box and press E to get the lens. In short I want it to turn on and off with F key only after I get the flashlight.I searched on YouTube and forums and couldn’t find a solution. I’m new to Unreal Engine 5 and I would really appreciate your help
Add a Boolean (HasFlashlight), which prevents using On/Off while False. Once flashlight is obtained, set it to True.
Thank you sp much.solved,but now I need a trigger box near the flashlight because the boolean works everywhere. I need it to work only inside a trigger.can i do this?
You can add a collision to the flashlight bp (assuming it is an actor), which on overlap will toggle another boolean in your character blueprint via a blueprint interface (or casting, if you’re more comfortable).
You may need to watch some youtube tutorials on interfaces and overlap events, but I laid out the basics below:
I couldn’t come up with proper function names or properly place the final boolean and branch (last photo) as I don’t fully understand the concept of restricting the flashlight’s use to a certain spot. But, as long as it makes sense to you, you should be able to work through it.