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"));
}