Just for curiosity, I checked if Ben was right, and I convinced myself by logging in Tank’s constructor and in the TankAimingComponent’s constructor. After I compiled, Unreal crashed, and then i tried to reopen the project, but it crashes all the time.
Aiming component .cpp file
UTankAimingComponent::UTankAimingComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = false;
auto TankName = GetName();
UE_LOG(LogTemp, Warning, TEXT("MONKEY: %s's C++ aiming component constructor called"), *TankName)
}
Tank .cpp code
ATank::ATank()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
auto TankName = GetName();
UE_LOG(LogTemp, Warning, TEXT("MONKEY: %s's C++ tank constructor called"), *TankName)
}