Enhanced Input C++: Binded function in parent not working

I have a Tank pawn and a SentryTurret pawns, Tank is controlled by player. They both inherit from BasePawn class. In Tank there is a Move function binded to an action and in the BasePawn there is a Fire function that is binded to an action in Tank. The issue is that Move function works fine but Fire function doesn’t even display UE_LOG.

Code for binding:
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ATank::Move);
EnhancedInputComponent->BindAction(FireAction, ETriggerEvent::Triggered, this, &ATank::Fire);

I tried going with &ABasePawn::Fire but I found out it’s not allowed for some reason
From what I saw this is how you do it on old input system. Did anything change?

TankTest.zip (49.7 KB)

Setup for fire for tank with base pawn + child actor sentry that is hooked up as secondary fire

  • prime fire mouse left button
  • secondary fire mouse right button

Right click uproject and generate vs project.

The Super::Fire() (and secondary) decide if the base class is called too.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.