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

Using the 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 the monster in the world and then spawn another pawn (hero) next to it. The overlap doesn’t trigger until i click on the hero object in the world outliner. Its really strange.doing.

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

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

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


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

I have attempted a simple repro using a test blueprint setup, but I haven’t seen the 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 the hero and the monster are overlapping.

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

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

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

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

Edit: After even further investigation it appears that collision components added in code is the root cause. i added box components to the hero and monster blueprint and they appear at 0 with the 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 the collision component in code to save time adding it to each blueprint child

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