If 2 events true to execute code

Hey all, I was wondering if in Unreal Engine Blueprints I could check if 2 Events are true in order to execute the rest of my script. In my case I want to check if ‘G’ key is pressed AND are overlapping the box collision in order to do the rest of the stuff. How could I achieve this?

You can add an if statement after the event key pressed and test if the actor is overlapping the other actor like that :

The ´Object´pin should be a subclass of ThirdPersonCharacter, depending on what you want to do, it could be a ´Self´ reference…

Right click, type self and select ´Get a reference to self´

The G key pressed should be in your custom character, so self is your character. The other actor should be the overlapping Box.

It seems like it should work but can you help me with this issue. on the screenshot

I do not know what the object on cast to third person character should be
All of this code is on a “Shop” blueprint class and i want the code to happen when the player is pressing g and overlapping the shop object.

How would i do that? I just tried putting ‘object’ to self reference but it warns me Third person character does not inherit from shop and it didnt work…

Also on the Is Overlapping Actor, on the "other’ pin how do i reference third person character bp?

Yeah self reference warns me and doesn’t work.

Aye, then just call the function in the other actor. lemme try it thanks

How do I make the is overlapping actor “other” reference to the overlapping box?

Yeah everyone said i just right click while selected it ima restart my engine because i dont have that option…

I restarted the engine and I selected the shop bp in the editor scene. Now in my third person character bp i right click and it doesnt work. i dont see the option.

The reference works in the level blueprint, should I just do it there?

If your overlapping box is placed in the level, you can use ´GetAllActorOfClass´ on beginplay and set it to the character. Or click on it in the level and open the level blueprint and right click → select ´Create a reference to YOUR_ACTOR_NAME´ and in the begin play get your character and set it.

IT WORKS IT WORKS THX HABIBI IT WORKS