Overriding Input Action Events in Child Player Controller Crashes Editor

Steps to Reproduce:

1. Create a new Project. In Project Settings > Input, add an Action Mapping “TestAction”.
2. Open the event graph for the Player Controller Blueprint associated with the current Game Mode, add an InputAction event node for TestAction. Drag off either execution pin and add any node (print string)

3. Compile and save.
4. Create a child of the Player Controller, open its blueprint. In the My Blueprint panel, select functions to override.

5. It looks like this override list gets populated with the InputAction node’s instance Id, not the actual overridable function’s name.
6. Selecting that function causes a check to fail in SMyBlueprint.cpp::ImplementFunction() – line 2069

Note: Right clicking in the child’s event graph and adding the node works fine.

Call Stack:

>             UE4Editor-Kismet.dll!SMyBlueprint::ImplementFunction(FEdGraphSchemaAction_K2Graph * GraphAction) Line 2069             C++
               UE4Editor-Kismet.dll!SMyBlueprint::ImplementFunction(TSharedPtr GraphAction) Line 2024 C++
               UE4Editor-Kismet.dll!TBaseSPMethodDelegateInstance<0,SMyBlueprint,0,TTypeWrapper __cdecl(void),TSharedPtr >::Execute() Line 282   C++
               UE4Editor-Kismet.dll!TBaseSPMethodDelegateInstance<0,SMyBlueprint,0,void __cdecl(void),TSharedPtr >::ExecuteIfSafe() Line 387       C++
               UE4Editor-Slate.dll!SMenuEntryBlock::OnClicked(bool bCheckBoxClicked) Line 976          C++
               UE4Editor-Slate.dll!SMenuEntryBlock::OnMenuItemButtonClicked() Line 927     C++
               UE4Editor-Slate.dll!TMemberFunctionCaller::operator()<>() Line 161           C++
               UE4Editor-Slate.dll!TTupleImpl >::ApplyAfter_ExplicitReturnType >(TMemberFunctionCaller && Func) Line 113 C++
               UE4Editor-Slate.dll!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,0,FReply __cdecl(void)>::Execute() Line 282          C++
               UE4Editor-Slate.dll!TBaseDelegate::Execute() Line 440                C++
               UE4Editor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 236   C++
               UE4Editor-Slate.dll!SMenuEntryButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 361 C++
               UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::(const FArrangedWidget & TargetWidget, const FPointerEvent & Event) Line 4276   C++
               UE4Editor-Slate.dll!FEventRouter::Route(const FArrangedWidget &, const FPointerEvent &) >(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::FReply (const FArrangedWidget &, const FPointerEvent &) & Lambda) Line 214         C++
               UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent(FWidgetPath & WidgetsUnderPointer, FPointerEvent & PointerEvent) Line 4266              C++
               UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(FPointerEvent & MouseEvent) Line 4663       C++
               UE4Editor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button) Line 4641         C++
               UE4Editor-Core.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 1404      C++
               UE4Editor-Core.dll!FWindowsApplication::DeferMessage(TSharedPtr & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 1709      C++
               UE4Editor-Core.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 707           C++
               UE4Editor-Core.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 629           C++
               [External Code] 
               UE4Editor-Core.dll!FWindowsPlatformMisc::PumpMessages(bool bFromMainLoop) Line 884     C++
               UE4Editor.exe!FEngineLoop::Tick() Line 2397      C++
               UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 142                C++
               UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 189      C++
               [External Code]

Hi Sheri,

I can confirm that this crash occurs in 4.9.2 and 4.10.2, but in 4.11, the ability to explicitly override the input action events via the My Blueprint tab has been removed. I’m not certain whether this is intended or not, and I’ll follow up once I have some more information. Thank you for the report!

So, in 4.11, this was removed as an option from the “override functions” list on purpose. As you experienced, it did not work. You can still override the input event in your sub-class, just place the same input event node there and work from that. If you desire to execute the super’s functionality as well, then I’d suggest adding a custom event node in your parent Blueprint, and invoke that from the input node. Then, in the child, you can cleanly override that custom event and also call the super method.

To give you more insight into why this was removed (and not “fixed”), know that the event listed there in the list was a hidden auto-generated event that we use behind the scenes to get the input node to work. You were getting a peek behind the curtain, to the Blueprint’s inner workings (hence the odd naming of the function).

A lot of times, to make things more accessible we’ll wrap up several nodes worth of functionality into a single node, and then, during compile, that node gets “expanded” into a small network of nodes that actually make up its functionality. Here, behind the scenes, we generate two event functions (one for pressed and one for released) - This is an intermediate step that you shouldn’t have to worry about. So we made sure functions like this are hidden from the override list.

The input node as you know it will not show up in that “override function” list, primarily because it is not tied to a single function. It is a special event node that expands out to be more than what it appears.

Hope this clarifies things a little bit!
Cheers - MikeB

Sheri,

Not to leave you hanging, I am currently the one looking into this. I am trying to see what in 4.11 is hiding this option. I’ll let you know if it was intentional or not. With that said, could you just hand place the ActionMapping event node in your graph manually?