Child setUpPlayerInputComponent

I currently have a Parent C++ character class that contains basic code that different child classes can inherit from. In my child class I want to set up a player input component that will call a function to cast an ability that only that child class will use. However my child class implementation of setUpPlayerInputComponent never seems to be getting called.

Parent Class

void ABase_Character::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent){
check(PlayerInputComponent);

PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping);

PlayerInputComponent->BindAxis("MoveForward", this, &ABase_Character::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &ABase_Character::MoveRight);

PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
PlayerInputComponent->BindAxis("TurnRate", this, &ABase_Character::TurnAtRate);
PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
PlayerInputComponent->BindAxis("LookUpRate", this, &ABase_Character::LookUpAtRate);

PlayerInputComponent->BindTouch(IE_Pressed, this, &ABase_Character::TouchStarted);
PlayerInputComponent->BindTouch(IE_Released, this, &ABase_Character::TouchStopped);
}

Child Class

 void ABeast::SetupPlayerInputComponent(UInputComponent * PlayerInputComponent) {

Super::SetupPlayerInputComponent(PlayerInputComponent);
    PlayerInputComponent->BindAction("Special", IE_Pressed, this, &ABeast::ShadowMode);
 }

 void ShadowMode() { UE_LOG(LogTemp, Warning, TEXT("Ability Used")) }

Hey AAjax-

Did you set the Default Pawn Class to use the ABeast class / blueprint in your game mode? If not it my be using the wrong character which doesn’t have the same bindings you’ve setup. If possible please include a screenshot of your World Settings for more information.

1 Like

that was it, I had the default pawn class assigned to the parent class! Thank you very much

If you spawns your own character - you should to possess player controller on it.