C++ ACharacter overlapping different kinds of AActors - Observer pattern?

You can avoid being concerned about the type by giving the collectables a common base class or interface function and calling it.

for example


auto * Collectable = Cast<ACollectable> OverlapTarget;

if (Collectable)
{
  Collectable->HandleOverlap();
}