Input without pawns and actors?

Hey everyone, I am still a noob when it comes to Unreal Engine, yet I consider myself a capable programmer in general, and therefore I really wonder why I cant figure out how this works: I basically want to resolve Input without binding anything to a Pawn or Actor. I am using a custom Player Controller, but whenever I try to bind an input action via bindAction(), it highlights the reference to the Controllers own “Resolve Input”-function as invalid.
My goal is to simply increase an int variable which is element of my controller class by 1, whenever I press the ‘W’ key. Is there any way to do this without building weird workarounds including pawns? Your help is much appreciated.

The input is received by UGameViewportClient which then dispatches it to actors and controllers. If you want to directly process the input consider deriving your class from UGVC. Note however, that this class is relatively low-level and is generally not meant for gameplay input processing.

Sounds good to me, I’ll check it out! Thanks for the help!

You can bind actions directly to PlayerController functions just fine. Depending on your project setup it may be preferable.

For some reason I couldn’t make it work. Might be me screwing up. But to be honest, the moment I saw the input functions of the ViewportClient, I kinda fell in love with it.

Yet I did run into trouble again: Since Viewport-Client is generated “somewhere” inside the engine, is there a way to get a reference to it in my game mode constructor?

EDIT: SOLVED! Finally found the GEngine thingy :slight_smile:

Accessing the Viewport Client from the Game Mode is generally not a good idea. Game Mode is server-only and the Viewport Client is client-only. It might be ok if you are making an SP game though. Also I would not recommend trying to find a Viewport Client (or any other engine- or game-level object) from a constructor. There is a special instance of each class called Class-Default Object created at the moment when the class is loaded. The engine is not yet initialized at this point and GEngine might not even exist.