Been working on a little project that works fine in standalone mode. My architecture so far has been all input logic goes in an APlayerController, the input callbacks in turn call functions in an AActor, allowing it to move.
I’m trying to test if multiplayer will work, so I turned on Replication on the AActor, it’s SkeletalMeshComponent, and on the APlayerController. I set the number of players to two and set the Net Mode to Play As Listen Server. An assert gets called in my code:
QPlayerController.cpp:
EnhancedInputComponent = Cast<UEnhancedInputComponent>(InputComponent);
checkf(EnhancedInputComponent, TEXT("Unable to get reference to the EnhancedInputComponent."));
Continuing, there’s a read access violation within EnhancedInputComponent.h on line 439:
DEFINE_BIND_ACTION(FEnhancedInputActionHandlerValueSignature);
Am I setting up the UEnhancedInputLocalPlayerSubsystem incorrectly? ChatGPT suggested I initialize the UEnhancedInputComponent in the constructor with CreateDefaultSubobject<>(), but the same error still occurs and it was working fine in single player without it.
So what might I be doing wrong here? My code can be found here: https://github.com/rancidponcho/QDuel