Branch node's false side not working

The branch coming out of the F key does not work for the false side; it will not print the string. The true side works just fine. Is this a bug or am I missing something?

Hello @551810 !

Something like?
key



1 Like

@alberto Thanks for the reply. Your code would solve the problem, but mostly I’m wondering why the branch doesn’t work. Even if I disconnect HasCorrectKey? and set the condition to false, it still doesn’t print the string. Is it a bug in UE5 or am I doing something wrong?

I took a look and I think you are missing some nodes


In this case, it can be activated by whatever else isn’t it?

Not sure because the screenshot is not complete, but I guess there is a small error somewhere
image

The screenshot is was not complete, my bad.

The part highlighted in blue is what is not working. Everything else works perfectly. My goal is to have a string printed when the player does not have the correct key.

The logic to set “Has correct key” is the problem
Move to when F is pressed

mm I’ll try to explain better

when you try to open the door and you are close, is when the system checks if you have the right key

I see is the big difference
Overlap->you can interact
interact->do you have the key number 3?

Oh ok i think I understand. Give me one second.

Sure, let’s say overlap is not opening a channel “while you are overlapping”

Hi there,
If player doesn’t have a key and the door is locked, the Enable input to the door will never fire, therefore the F input will never trigger false inside the door BP. That means your player still has input enabled. For the print string in the F input false, you can:

  1. move that print string part to your player blueprint.
  2. Enable input regardless player has key, whenever player overlaps. Then, disable when ending overlap

Also, if the door is unlocked, the F input will never be enabled. That is another reason you want to enable input always when begin overlapping.

Yeah but even if I manually force the condition to false it still wont print.
ddd

Yeah because is not asking to the player pawn

Try something like this:
image

1 Like

and then what is going to happen if the player doesn’t press F and remove the key from the inventory?

Once he press F is when we check if it has the key or not I think

I dont know, I tested it and it seemed to work fine with multiple doors.

Anyway thank you both for your help. It took me a while but I finally understood it.

2 Likes

Great. Remember to enable input for the player when ending overlap.
Keep up the good work.

Well… Just to say this is wrong:


It means:

  • ok player is close then door is unlocked
  • then the player destroys the key or whatever
  • door still open

Logic should be when the player tries to open, to be close is just the chance to press F

what do you think @L.F.A ?

That’s correct, overlaps (begin and end) should toggle input enable/disable for the door.

1 Like