Overlap events, such as OnComponentBeginOverlap seem to stop working when the actor is moved to a sub level. This does not occur if the object is deleted and then replaced in the level.
UFUNCTION()
void OnOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
UBoxComponent* BoxCollision;
UStaticMeshComponent* OverlapMesh;
AOverlapActor::AOverlapActor() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; BoxCollision = CreateDefaultSubobject<UBoxComponent>(TEXT("Box Collision")); SetRootComponent(BoxCollision); BoxCollision->OnComponentBeginOverlap.AddDynamic(this, &AOverlapActor::OnOverlap); BoxCollision->bGenerateOverlapEvents = true; OverlapMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh")); static ConstructorHelpers::FObjectFinder<UStaticMesh> Mesh(TEXT("/Game/Geometry/Meshes/1M_Cube.1M_Cube")); if (Mesh.Succeeded()) { OverlapMesh->SetStaticMesh(Mesh.Object); } OverlapMesh->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform); OverlapMesh->SetWorldScale3D(FVector(.25, .25, .25)); } void AOverlapActor::OnOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) { Destroy(); }
Result: The overlap event no longer works when the object is moved to a sub level
Expected: The overlap event would continue to fire
i have this problem UE4CC-Windows-58DC12AF4B97F057BD108FBFF569B2E9_0000
I am not able to find world outliner how to enable it?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
Bullet replication problem. The players sees each other but does not see the bullet
Installer 4.10 failed with error code R-1603
How does UMG set overlapping layouts?
Hey, why do i get this when i snap two similar meshes together?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-41412 in the post.
3 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.13, 4.14, 4.15 |
Target Fix | 4.18 |
Created | Feb 1, 2017 |
---|---|
Resolved | Aug 25, 2017 |
Updated | Jun 11, 2019 |