This is what I did when my gun wouldn't fire after the 1st compile using 4.19.2

Hi all

When I moved my PlayerInputComponent->BindAction(“Fire”, IE_Pressed, Gun, &AGun::OnFire);
out into the void AFirstPersonCharacter::BeginPlay()

it did not Fire so I took off Player form InputComponent->BindAction(“Fire”, IE_Pressed, Gun, &AGun::OnFire);

and it worked.

hope this helps someone

Thanks, it worked for me. I was looking all over for an Input Component member variable that was attached to the FirstPersonCharacter. I went into debug mode and saw that the variable InputComponent is defined two levels up from FirstPersonCharacter in the AActor parent.

This is good to know when I want to create input bindings on the fly.

Privacy & Terms