Detect user input



  • I need to detect when a user presses a key to add a special ability. In this case I specified the G button in the “Key/ Button Pressed” Kismet node. It works for PIE but not when I start a server and connect to it.

    I also tried to attach the event to the player-controller.

    How to do this?



  • Depends. I haven’t been able to get this to work myself either, but I do have a workaround if it’s an event only you (as mapmaker) should be able to trigger.

    Otherwise, if you just want to trigger it with G for everyone because G is the default “drop item” key, detect for “GBA_DropItem” instead. Make sure to try online if it doesn’t work in PIE.



  • Thanks for the advice. I tried with “GBA_DropItem” but still doesn’t work with a server.
    I indeed try to detect keys for every client which connects to the server. The problem here is that Kismet is server side unless the ‘client side only’ is checked on the node. But it also doesn’t work with this option. So I suppose UnrealScript is the way to go but my experience with this scripting language is very limited. Any leads?



  • That works for me:
    key pressed clientside only->client to server bridge->do something
    instigator = player controller



  • You got it to work? Awesome! But I have troubles replicating your solution. For me it looks like this:

    Again the same issue: works in PIE but not when I create a server and join it. How did you test your solution?



  • Enable Trap input and it should work. I have the same setting.

    I test on my dedicated server.



  • Great, it works! Thank you, your need is on me ;)



  • if you ever need a favor i am your man

    Promote your work when its done )



  • What if the player bind an action to this key. It could be very problematic. Why not use the standard action key ? Maybe with a timer ? (must stay pressed for X seconds)



  • Yes, a player should not bind anything to this key. But on my opinion it works good enough this way. The action needs to be executed immediately. It is used for the backjump ability for the Sandcastle map.



  • Dont forget to deactivate the key press detection when the player uses the chat. Maybe it’s automatically done, but just in case, check it.


Log in to reply