I’m having some issues in 4.16.2, my solution to which has caused the gun to spawn two projectiles though OnFire(). So the code below does not paste into BeginPlay() because ‘PlayerInputComponent’ is not recognised (its only referenced in the Setup function)
if (EnableTouchscreenMovement(PlayerInputComponent) == false) {
PlayerInputComponent->BindAction("Fire", IE_Pressed, myGun, &AGun::OnFire);
}
Resultantly I just moved the code spawning the gun into the SetUpPlayerInputComponent() function instead of the solution in the video which works in the opposite way (Moving input binding to BeginPlay()). The gun works as expected and there is only one instance of the gun being created, however when I right click I get two projectiles.
Has anyone else experienced this and found a solution, its not a major problem but it would be nice to know how to fix.