I have a C++ Class EnemyBaseClass. It has this function in:
void AEnemyBaseClass::OnEnemyClicked(UPrimitiveComponent* pComponent, FKey inKey)
{
UE_LOG(LogTemp, Log, TEXT("WAS CLICKED"));
}
The Constructor has this:
GetMesh()->OnClicked.AddDynamic(this, &AEnemyBaseClass::OnEnemyClicked);
-
I have a Blueprint called BP_EnemyBaseClass which is based on the C++ class.
-
I have another Blueprint called BP_BadGuy that inherits from the BP_EnemyBaseClass Blueprint.
-
I have several BadGuy blueprints placed in the world. When I click on them, nothing happens.
When I place a BP_EnemyBaseClass in the world, I can click it and the UE_LOG triggers.
I don’t understand what the deal is? I’ve set up the collisions properly. The clicking works fine if I use Blueprint and it works fine on the parent class, but on the BadGuy class that inherits from the EnemyBaseClass it doesn’t work. The UE_LOG never happens for the BadGuy Blueprints placed in the world.
Suggestions?