Not sure what you mean by not detect but if you’re wondering why rider’s warning you about
ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer());
It’s because you call GetSubsystem
but do nothing with the result in an optimized build. The compiler won’t even include this code as it does nothing at all. This entire statement is effectively a no-op.
APlayerCharacter *PlayerController = Cast<APlayerCharacter>(Controller);
if (PlayerController)
{
ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()); //<--- this one
}
}