I has a horse character that inherits a base character class. And in the SetupPlayerInputComponent() method, I bound a DismountAction to the Dismount method as follows:
void AHorseCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
if (UEnhancedInputComponent* enhancedInputComponent = CastChecked<UEnhancedInputComponent>(PlayerInputComponent))
{
enhancedInputComponent->BindAction(DismountAction, ETriggerEvent::Triggered, this, &AHorseCharacter::Dismount);
}
}
I also had created the required assets and assigned them in the editor. But only the bound actions in the base class worked, the above binding was not fired when I pressed the binding key specified in the Input Mapping Context.