If I drag a character from the project, and start the game already with him, then he is always visible. But if I create a character in runtime, then such a bug occurs.
ABaseEntity* AEntities::Spawn(const FString& cs, const FVector& vector, ETeam_t team, UWorld* world, AActor* net_owner)
{
const FString fullPath = "Blueprint'/Game/Units/" + cs + "." + cs + "_C'";
const TSubclassOf<AActor> SpawnActor = Cast<UClass>(StaticLoadObject(UObject::StaticClass(), NULL, TCHAR_TO_WCHAR(*fullPath), NULL, ELoadFlags::LOAD_Verify, NULL, true));
FActorSpawnParameters SpawnParams;
SpawnParams.Owner = net_owner;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
ABaseEntity* actor = world->SpawnActor<ABaseEntity>(SpawnActor, vector, FRotator::ZeroRotator, SpawnParams);
actor->SetTeam((int)team);
actor->TeleportTo(vector, FRotator::ZeroRotator);
actor->RegisterComponents();
actor->SpawnDefaultController();
return actor;
}