I have an Input_Action node on the BP_FirstPersonCharacter that will make a line trace that will start an interact_Interface with an object that it hits.
I think it would be really helpful for the player if I could use that same button for more than just a line trace. I’m trying to put documents in this game that will work in a similar way to Resident Evil or Silent Hill; it’s going to create widget and I’d like to flick through the text on the widget and then close the widget using the same button.
I tried putting that same Input_Action node in a widget, it works; the linetrace hits the document actor, opens a widget, flicks through it, but when it closes the widget, the action stops calling a linetrace. I’ve tried creating a boolean in the BP_FirstPersonCharacter, but that hasn’t worked. I tried a different input action using the same key in different BPs, that didn’t work. I’ve tried adding Print_Strings everywhere and noticed that after I call the Input_Action on the widget, it stops calling for the BP_FirstPersonCharacter at all.
Player pawn or player character will consume input when its triggered. Yes you can change it to not consume, however during development you probably will forget to change it back, and that may cause weird behavior (because you forgot reason for it, or where to change it back).
Better way is to code that (so you see how it works even if you forgot).
For that:
create dispatcher in player character, lets say Dispatcher_LineTrace
then in blueprint with line trace: get player character > assign dispatcher (and pick Dispatcher_LineTrace)
then in blueprint with input (probable player character), call that dispatcher ie. trigger it.
This way everything that needs to be aware of that input gets triggered.