BindAction for second player only fires when first player is also performing the action

Hi guys,

I have a local multiplayer game, after spawning two players using:

UGameplayStatics::CreatePlayer(World, -1, true);

I noticed that the movement works correctly, but one of the players can only perform their binded actions when the other player is doing so. e.g. Player 1 is attacking, if player 2 presses their attack button they will attack, but the moment Player 1 stops attacking player 2 cannot attack. It is noticeable that even if player 2 is pressing the alternative attack they will perform the same attack as player 1.

Now i assume that for each player my ACharacter subclass is spawned, so i have no idea why this would be the case. My code for binding is as follows:

void AIGCCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{

// Set up gameplay key bindings
check(PlayerInputComponent);

PlayerInputComponent->BindAxis("MoveForward", this, &AIGCCharacter::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &AIGCCharacter::MoveRight);
PlayerInputComponent->BindAction("AttackLeft", IE_Pressed, this, &AIGCCharacter::AttackInputLeft);
PlayerInputComponent->BindAction("AttackRight", IE_Pressed, this, &AIGCCharacter::AttackInputRight);
PlayerInputComponent->BindAction("AttackLeft", IE_Released, this, &AIGCCharacter::AttackLeftEnd);
PlayerInputComponent->BindAction("AttackRight", IE_Released, this, &AIGCCharacter::AttackRightEnd);
PlayerInputComponent->BindAction("Dash",IE_Pressed, this, &AIGCCharacter::PerformDash);
PlayerInputComponent->BindAction("Dash", IE_Released, this, &AIGCCharacter::DashEnd);

// "turnrate" is for devices that we choose to treat as a rate of change, such as an analog joystick
PlayerInputComponent->BindAxis("TurnRate", this, &AIGCCharacter::TurnAtRate);

}

Any help would be appreciated.

I figured it out and on a whim too, turns out i had a my player variable in my animinstance as a global variable in the CPP file and not called out in the header, it appears unreal needs them to be in the header file to fix the issues… you live and learn.