Hi there,
i have a strange Problem. I made a base class for my weapon in c++. From this Baseclass i made a blueprint child. But everytime the base function is called, it doesn’t mater from the blueprintchild 1 or 2, everytime the baseclass is called.
Headerfile
UFUNCTION(BlueprintNativeEvent)
void Fire();
virtual void Fire_Implementation();
CPP File
void AWeaponBase::Fire_Implementation()
{
if (!this)
{
UE_LOG(LogTemp, Warning, TEXT("Weapon not found!"));
}
else
{
if (CurrentAmmo > 0)
{
CurrentAmmo -= 1;
}
else
{
UE_LOG(LogTemp, Warning, TEXT("No Ammo in Weapon"));
Reload();
}
// Call SpawnEmitterOnFiring throug Blueprints
SpawnEmitterOnFiring();
}
}
I spawn in my character 2 weaopns from it. It equips well and my hud Shows the right weaopn Name and the right ammo. But if i fire the weapon, only the c++ / or Basechild-Blueprint is called.
What i am doing wrong here?