Use which interface method?

IDamageableInterface* Damageable = Cast(OtherActor);
if (Damageable-> ???)
{
// Do stuff here
}

104534-interface.png

Why does a simple c++ interface give me 4 functions to chose from when I only have one in the actual class?

Declaration in interface:

	// Check if this actor can be damaged by the specified faction
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "IDamageable")
	bool CanBeDamagedByFaction(const int32 ByThisFactionId);

Declaration in actor:

// header
virtual bool CanBeDamagedByFaction_Implementation(const int32 ByThisFactionId);

// cpp
bool ASpaceShip::CanBeDamagedByFaction_Implementation(const int32 ByThisFactionId)
{
	return GST->GetFactionInstance(FactionId)->CanBeDamagedByFaction(ByThisFactionId);
}

I suppose that the “Execute_CanBeDamagedByFaction” is called from the interface instead from otherActor. But what is the difference between the other 3 and which one should I use?

It’s due to decorating your interface with “BlueprintNativeEvent” and “BlueprintCallable”. Unreal generates function versions which can be used in Blueprints. I think the former results in “CanBeDamagedByFaction_Implementation” and the latter in “execCanBeDamagedByFaction”. These allow you to override and call the functions in Blueprints.