this works, I hate it, but it works, needed an error message and forced return in PostInitializeComponents()
to prevent a crash.
used FindComponentByClass<T>()
where it has the cast built in.
void AMyActor::PostInitializeComponents()
{
Super::PostInitializeComponents();
if( ActorComp == nullptr )
{
if( !(ActorComp = FindComponentByClass<UMyActorComp>()) )
{
UE_LOG(LogTemp, Error, TEXT("ActorComp unassigned for blueprint of %s"), *GetName());
return;
}
}
}