Extending FirstPersonCharacter with EnhancedInput

I’ve been learning the new EnhancedInput system and am currently comfortable with creating my own new C++ class based on Character and then setting up and hooking into all of the IA and IMC components for movement and other actions. However, I’m creating a new project based on the BP_FirstPersonCharacter so that I can have all of that built in from the start. The problem is I need to extend it to add new EnhancedInput functionality for things other than basic movement and jumping. I tried looking for a C++ class for the FirstPersonCharacter to extend but haven’t found anything. So my basic question is: how do I extend the built-in FPS functionality with my own new EnhancedInput stuff? I can still use the old ActionMapping. to get what I want but I really want to move away from that asap since it’s deprecated.

Is this even the correct approach? Should I just create a new C++/BP classes based on Character and just copy the built in FPS code?

Thanks!
-Mo

Hi Mo, are you using UE5+? The functions the template uses are built into the Character class already, such as Jump. With that said, you can easily create the new Enhanced Input system in c++ and copy the few existing Input Actions over from the Blueprint. There really isn’t much that you would need to do to get what the template has into c++, so it is a quick transfer. Copying would be your best bet to convert into c++, and gives you more control. Also, you can not build a c++ class from a blueprint class, but you can build a blueprint class from a c++ class.

Edit: The Input Actions can be used simultaneously by c++ and blueprints, the only difference being you have to bind the IA in c++. Your issue however would require that you derive a c++ class from the BP character class, which like I mentioned, you can’t. Only works the other way around.

Hello SteveRambo, thank you for the response. Yes, I am currently using 5.3.1. A lot of what I learned was on 5.0 so migrating things I’ve learned to the new system is part of the process heh. Anyway, if I’m reading correctly it sounds like I’d just create a new C++ class from Character (MoCharacter for example) and then just copy over what I need instead of creating a new class form the BP. Your post inspired me to look into the Character.cpp for the first time and wow does it have a lot of stuff, though I think I overestimated just how much stuff there is to get basic FPS controls going. From looking at the blueprint you’re correct, it doesn’t seem like all THAT much.

If I’m correct then this makes sense and I’m ready to move forward. Thanks again for the help.

-Mo

1 Like

That is correct. Implementing basic controls are easy with the already existing functionality, which is nice. There will be times you need to override some of the built in functions, so it helps to familiarize yourself with how things work. As an example, the Crouch function works like it should, but it causes the camera to snap into place, rather than smoothly transition. This would be an instance where you would override the function and add a smooth camera transition. Best of luck to you on your future projects.

This is so awesome, I love the fact that all the core functionality is just there for you to use and adjust at will. Maybe my previous tech that I’ve worked with jaded me to that possibility haha.

1 Like