My project is based on Twin Stick Shoot Template. Here’s what I did, I list it for clearly expression:
- I create amy own PlayerController named ASurvivePleasePlayerController.
-
PlayerControllerClass = ASurvivalPleasePlayerController::StaticClass();
in constructor of game mode. - I add input config in ProjectSettings - Input.
- I BindAxis in ASurvivePleasePlayerController::SetupInputComponent.
- I use GetInputAxisValue in ASurvivePleasePlayerController::PlayerTick
And I got a problem, GetInputAxisValue return 0 in any condition.
Here’s what I tried:
- BindAxis in ASurvivePleasePawn::SetupPlayerInputComponent and call GetInputAxisValue in ASurvivePleasePawn::Tick ->always return 0 as well
- Remove
PlayerControllerClass = ASurvivalPleasePlayerController::StaticClass();
in gamemode constructor and use default PlayerController automatically ->GetInputAxisValue in ASurvivePleasePawn::Tick worked!
I think there something wrong with my ASurvivePleasePlayerController, but I can’t locate the issue. Can anyone do me a favor? Thanks a lot in advance!