Blueprint - And?

Is there a blueprint that covers and? I’m trying two write a blueprint, and only want something to happen if two things are true. Using a branch with two items connecting to it’s exec doesn’t work, so I’m lost here.

2721-capture.png

I want something to happen when the actor overlaps with the trigger volume AND E is pressed (to use). How do I make this happen? I don’t see anything for “and” in blueprints.

This current idea I have seems to function as an or, not an and. If overlap or e is pressed, it’s true. Not if overlap and e is pressed.

For this specific example of using AND I would suggest storing the overlapping state in a bool as a separate chain of events. Then when the key is pressed you check if this bool is true or not.

Try using a Gate for this (Flow Control>Gate). Send your input event into the Enter input. Send the trigger volume BeginOverlap into Open and an EndOverlap into close. Then the gate will only be open when you’re inside the volume.

Only problem is I’m not sure how to use the SET box, or even what that is? I’m brand new to Unreal Engine 4 and BluePrint. I searched SET and found “Set Tags” which looks like it, but I don’t see how to add Is Overlapping? Does it matter that mine is a Begin/EndOverlap (Trigger1)?

Nevermind! I just figured out that I can create new variables in BluePrint, and that it how you do it. Wow, this is a bit different than Kismet xD

Thanks for the idea, but I ended up using Dieselhead’s answer. Your’s sounded like it would work as good though aha

I did not know about the Gate node myself and I’ll certainly make use of it in the future, so thanks :slight_smile:

It’s great to know all the different ways one can do something, so I’m happy too! I’m nervous to get into C++ scripting. I write a ton of Python programs, but C++ has always been a bit overwhelming haha.

You need to create a new bool variable. You can name it Is Overlapping or whatever you want. Then you drop it into the blueprint and use Set.

You see how Event Actor Begin Overlap leads to the SET function for “Is Overlapping” variable. The check box = true so it is “Setting” the “Is Overlapping” variable to true. Then, you “Get” the “Is Overlapping” variable and you route it into your branch so that when you press E it will only fire if the branch shows true.

For more detailed walkthrough, I highly recommend the Blueprints video series created by epic. It discusses this same issue a few videos in: - YouTube

Nothing wrong at all with Dieselhead’s solution. The Gate is basically just doing the same thing “under the hood”. You’ll find with the flexibility and power of Blueprints, there’s often several ways you can do the same thing. :slight_smile: