// Jeangrey´s c++ code
// Enhanced Input in BlasterPlayerController
// BlasterPlayerController.h
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)
UInputAction* QuitAction;
// BlasterPlayerController.cpp
void ABlasterPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
if (InputComponent == nullptr) return;
if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(InputComponent))
{
EnhancedInputComponent->BindAction(QuitAction, ETriggerEvent::Completed, this, &ABlasterPlayerController::ShowRetunToMainMenu);
}
}