Editor freezes when second collision box added to actor [reproducible]

This lock-up is reproducible with a new 4.8 C++ FPS project.

An actor with two trigger boxes causes the editor to lock up. This may be a “Doctor, it hurts when I do this”…“Well then don’t do that” sort of thing, but it does compile without complaint and it would be useful to have an actor detect collisions at multiple ranges.

Below is the offending code if this is worth looking at…

.h:

UCLASS()
class DUALOVERLAP_API ALocker : public AActor
{
	GENERATED_BODY()
	ALocker(const FObjectInitializer& ObjectInitializer);

	UShapeComponent* Box;
	UShapeComponent* OuterBox;
	
public:	
	// Sets default values for this actor's properties
	ALocker();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

private:
	UFUNCTION()
		void TriggerEnter(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);

	UFUNCTION()
		void OuterTriggerEnter(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);
	
};

.cpp:

ALocker::ALocker(const FObjectInitializer& ObjectInitializer)
{
	Box = ObjectInitializer.CreateDefaultSubobject<UBoxComponent>(this, TEXT("Box"));
	Box->bGenerateOverlapEvents = true;
	Box->SetRelativeScale3D(FVector(28.5, 37.75, 4));
	RootComponent = Box;
	Box->OnComponentBeginOverlap.AddDynamic(this, &ALocker::TriggerEnter);

	OuterBox = ObjectInitializer.CreateDefaultSubobject<UBoxComponent>(this, TEXT("Box"));
	OuterBox->bGenerateOverlapEvents = true;
	OuterBox->SetRelativeScale3D(FVector(30.5, 39.75, 4));
	OuterBox->AttachParent = Box;
	OuterBox->OnComponentBeginOverlap.AddDynamic(this, &ALocker::OuterTriggerEnter);
}
void ALocker::TriggerEnter(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)
{
	UE_LOG(LogTemp, Warning, TEXT("FUNCTION ALocker::TriggeEnter"));
}

void ALocker::OuterTriggerEnter(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)
{
	UE_LOG(LogTemp, Warning, TEXT("FUNCTION ALocker::OuterTriggeEnter"));
}

Hey pagancyc-

The reason you’re getting a freeze is because of lines 3 and 9 from the .cpp you posted. In both lines the TEXT is “Box” which is causing a naming conflict. If you change one of them to something else then you should be able to add an instance of the class or a blueprint based on the class to the level.

Cheers

Oh brother, that’s what I get for working when I am tired.

Thanks very much, and I apologize for posting such a brainfart.

Pagan