Understanding C++ input

Hi.

I am taking the Third Person tutorial for the networking and tryng to apply noptions in the Top Down template.

I implemented the networking code but I can’t understand how to add and trigger the fire action.

May be I am going fast with my goals, but I ask you to help me to make order to some concepts.

First, in the tutorial is shown how to add an input action, but in the Top Down template I can’t see no mapped input. I think this is because (as the editor write) this kind of mapping is deprecated. So I think the advanced input is used, but I can’t understand how it works.

Second, I understand that the player is managed by a game mode and a game controller that use input mapped events to do actions. For now I used only blueprints but for the networking tools I need to use C++. Taking the Top Down template, I can see these components both as blueprint and C++ classes and I can’t understand if they are related (in this case how I can “link“ blueprint with C++?) or if they are just various tools implemented in differents ways (in this case how I can understand what C++ components are used?).

Last I found .h and .cpp controller files that use a mapping (I think the advanced as I said before) but I can’t understand how to bind a keyboard button to trigger the player actor fire method.

So I am asking you to help to understand those concepts with a little explanation and, may be, suggesting me the tutorials / documentation to read.

For now I searched, but I have troubles with find the specific informations and give them the correct “order“.

Very last, when I tryed to compile the Visual Studio solution, i have some error that don’t allow mw to succesfully compile. They are about vulnerability in some packages NuGet (May depends about the engine version?).

Sorry about the confusion, but I really need help to make order in all those things.

Thanks.

Enhanced Input is the newer way, and much easier to manage:

Basically: As you point out it all runs thru the PlayerController. It uses basic data assets for setting up an input: Input Actions and Input Mapping Context. Input Action is what type of action it is (button press, analog stick). You assign Input Actions in an Input Mapping Context to the button/key/stick inputs similar to the old system. You then add and remove this Input Mapping Context using the PlayerController->AddMappingContext and RemoveMappingContext, wherever you need them. So you can add when picking up a gun, and remove when dropping the gun for instance.

As to blueprint/c++ this video is a great explainer (also check his other unreal vids out, top notch):

Blueprints are basically extended from c++, and use similar inheritance.

The compile errors may be from not being able to download the vulnerability definition packages. I get this sometimes when I don’t have internet access on my build machine. I haven’t found a way to suppress them though

Thanks very much. Those documentation is a part of what I am searching.

What I can’t still understand is why modifing and recompiling the c++ controller I can’t add actions (in the project template).

I added my action and setted it in the default context.

In the c++ controller I added the action setting that writing on the screen a message.

I checked the game mode used and tryed to set the c++ controller, but it is not recognized.

I tryed to create a BP controller reparented with the c++ controller.

Now it is recognized, but all its actions are not executed (actions are player movements, like the BP managed actions).

So what I am not understanding? In the .h file I can see some variables like the context.

Need I to “assign“ those variables to make the c++ controller work? So in this case I am not understanding how to use a c++ controller.

I thought the project was already using it, but checking the game mode I can see that it’s not the case. So, how can I switch to the c++ controller? It’s provided with the template, so I assume that it can work if correctly used.