I’m creating a set of mechanics that mess around with time dilation, I have made it possible for the character to slow time, including their own motion, and then hold an input which speeds their character up whilst maintaining the slowed time globally, I did this in the level blueprint. I also want to use the same input to make the character’s movement speed increase when time is not dilated (make them run) by increasing the max walk speed (and decreasing it when released) I have done this in the character’s blueprint. Both systems work fine when mapped to separate inputs, but if I try to use the same input for both actions then one of them (the one in the character blueprint, running with no time dilation, does not register the input anymore), how do I make this work?
Thank you.
P.S. before anyone asks for pictures of the blueprints I can guarantee you, given the fact that the actions are functional when mapped to separate buttons, that they do not give any help in answering the question.
if I try to use the same input for
both actions then one of them (the one in the character blueprint, running with no time dilation, does not register the input anymore)
Inputs get consumed - only 1 actor can process specific input at a time - this is the desired, default behaviour and it’s not recommended to change it unless you’re after something truly unique. You can disable it by selecting the input node and disable Consume Input.
Instead, consider handling input in the Player Controller / Pawn / Character - in one blueprint. Non-pawn scene actors should not really have access to it; it complicates handling input priority and debugging.
I just answered something somewhat similar here:
For example:
Player presses the TimeDilation key, have it dispatched. Any actors that need to get it can register their events with it. The dispatcher can carry data - the effect’s magnitude & duration, for example.