I am trying to make an interactable character that my main character can go up to, press E and trigger to talk. I created a blueprint based on a character class, added the ancillary characters idle animation asset, and then in that blueprint added a sphere collision. The attached image shows exactly what the blueprint looks like. The idea is to detect that the main character has collided with the ancillary character, then open a gate that waits for the ‘E’ key press. However the gate does not seem to be working. If I put Print String(log to console) earlier in the chain I can see that the collision is being detected because it does log successfully. If I change the E key press to an int and run a condition that is always true the string still won’t print… telling me the problem isn’t with the E key press event.
Does anyone have ideas as to what is going on here? I am really struggling with this. The logic seems okay but obviously I am not understanding how something works.
That looks ok, but component overlap is quite flakey. If you put print strings telling you when the overlaps start and stop, you’ll see they can trigger several times per second.
If you use the OnActorBegin ( and end ) Overlap node, it’s reliable.
I can try that although I just tested with print statements and this does seem to detect the collision well enough that I should get the E interact working at least occasionally… I am so confused. The logic here seems sound. Detect overlap then open gate, wait for key press, log to output.
I just did a quick test to see if I could get the gate to work, I got it working as I expected it to work and it let me print out to the console every time I pressed E as long as I was inside the bounds I set
However, for the Input E to actually work I had to remember to auto receive Input on the actor that has the E event inside of it
I have input enabled and consume input unticked… both were not set properly so thanks! BUT it still does not work.
To test the gate I got rid of the key press and have a condition that will always be true which should trigger the print statement. This too does not work… See image
Does the E key press event know to listen for E from the main character? This BP is on the ancillary character that just has an idle animation and is supposed to talk when E is pressed near it.
I got this working when the blueprint is derived from an Actor but NOT a character. As mentioned in the initial post this blueprint system is on a character blueprint. So something must be happening with E key input that is confusing this…
That’s why you should not enable input on actors. They get to process it first and consume it. If you put E input in an Actor, Level Blueprint and a Pawn, only the Actor gets to use it, the others will not see it.
You can disable consumption but that complicates things even further. If you can, handle inputs in the Controller / Pawn / Widgets only.