[BUG] Collision overlap doesn't work correctly PIE or standalone 4.12 Master branch

Using master branch updated to tip as of today. I have a pawn (monster) where i have overlap function in c++

CollisionComponent->OnComponentBeginOverlap.AddDynamic(this, &AMonster::OnOverlapBegin);

I placed monster in world and then spawn another pawn (hero) next to it. overlap doesn’t trigger until i click on hero object in world outliner. Its really strange.doing.

Doesn’t work in c++ or in monster blueprint. Only collision i get when i start game is with spectator pawn and not with hero pawn until i click on hero object in world outliner tab.

component i’m using for both pawns is UBoxComponent and i have collision present set to overlap all and generate overlap events enabled.

Edit: it appears that collision components are at 0 and dont move to mesh location until i click on object in scene outliner.


How are you adding your Box Components? Could you provide code?

I have attempted a simple repro using a test blueprint setup, but I haven’t seen same results as you, so seeing your code would be helpful in attempting to reproduce your issue.

I have a UBoxComponent* in my actor class

CollisionComponent = ObjectInitializer.CreateDefaultSubobject<UBoxComponent>(this, TEXT("CollisionCapsule"));

So i have a combat menu that only shows if hero and monster are overlapping.

    void AMonster::OnOverlapBegin(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
    	// Check if  overlapping actor is an investigator
    	if (OtherActor->IsA(AInvestigator::StaticClass()))
    		if (HasAuthority())
    			bIsSelectable = true;
    		// Only show  combat window to  client
    		auto owner = Cast<AInvestigator>(OtherActor)->GetOwner();
    		if (owner == nullptr)

When i start game menu should immediately be showing since hero and monster are overlapping but it doesn’t until i click on actor.

I spawn hero in code but monster i placed in scene.

This is what i see when i just add a hero and a monster to a blank level. Notice collision volumes are not with actors but offset.

Edit: After even further investigation it appears that collision components added in code is root cause. i added box components to hero and monster blueprint and they appear at 0 with mesh and trigger collision as expected. So worse case i have a work around but since i’m going to be creating multiple monsters and heros i added collision component in code to save time adding it to each blueprint child

Closed by user for user error. Resolving for tracking purposes.