Bug in overlap events between persistent/streaming levels

Hi All

I’ve hit some strange behavior that seems to have crept in some time between 4.6 and 4.8. I’m using streaming levels and have an actor that has an interaction sphere that detects overlap events. The C++ overlap event is called whilst the actor is in the persistent level but not in streaming levels. I made a blueprint from the C++ class and created a debugging string in the BP, from an overlap event from the same sphere component. That overlap event is called when the actor is in the streaming level, but not in the persistent level.

There seems to be a clean split between behavior in C++ and blueprints, between streaming and persistent level…?

Hi robbiecooper,

Thanks for the report! I’ve assigned one of our team members to look into this issue for you, and they’ll post here if they need any additional informaiton. It may be helpful to see the code you’ve written for the overlap event in C++ so we can attempt to reproduce this here.

Hi Ben
Its nothing very complicated;
ActivationSphere = PCIP.CreateDefaultSubobject(this, TEXT(“ActivationSphere”));
ActivationSphere->OnComponentBeginOverlap.AddDynamic(this, &ARRStaticFigureNode::OnBeginOverlap);
ActivationSphere->OnComponentEndOverlap.AddDynamic(this, &ARRStaticFigureNode::OnEndOverlap);
ActivationSphere->bGenerateOverlapEvents = true;

	bNodeIsActive = false;

void ARRStaticFigureNode::OnBeginOverlap(AActor* Other, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)

	ARRPlayerController* PlayerController = Cast<ARRPlayerController>(UGameplayStatics::GetPlayerController(Other->GetWorld(), 0));
	AActor* PlayerPawn = PlayerController->GetPawn();

	if (PlayerPawn == Other)
		if (!bNodeIsActive)
			bNodeIsActive = true;

However, the issue has gone. I was getting the issue when I dragged a StaticFigureNode from the list of classes to the left of the screen, and after I made a BP and dragged an instance of it into the screen. So I deleted that instance, recompiled the code, and dragged a new instance of the BP into the screen. It seems to be working as expected now.

Glad to hear it! Thanks for letting us know. I’ll go ahead and resolve this post for now, but if the issue returns please feel free to post a reply and we’ll look into it.

Hey Ben, the problem has started again. I made two new streaming levels and put the same actors in them. The set up is basically the same, but now the delegates arent firing for onbeginoverlap, or beginhit and endhit for when the character is looking at these actors. The character class registers both types of events and calls the delegates in the actors, but they arent firing…

I guess that’s a bit confusing- onbeginoverlap fires on the character but not the actor. Onstarthit is called on the character but it’s set to fire a delegate in the actor, which is not being triggered. I’ve tried rebuilding the BP’s from the C++ classes and replacing in the level, but this time that fix isn’t working.

Hey robbiecooper-

Could you send me your project so I can see exactly what is happening? If you upload the project to drop box you can send me a PM on the forums with a link to download it. Alternatively, if you could post setup steps I can try to reproduce this on my end.


Doug Wilson

Thanks Doug will send first thing tomorrow when I’m back in the office

Hey Doug, did you get the links last week? just wondered if you’ve got the project…

Hey Doug, could you let me know if you’ve downloaded the files I sent? Ta

Hey robbiecooper-

I have received the project you sent however I’ve not been able to open and test the project yet. There are a couple build errors in VS that I’m trying to work through and will update you once I’m able to test the project.

Ok, thanks for the update :slight_smile:

Hi Doug, I put a word doc in the drop box called “notes for Doug”, or something like that. It said to put ENGINE_API on that function. Please download that doc because it will also tell you how to reproduce the error…

The compile errors seem to come from unresolved externals in FStreamLevelAction::FindAndCacheLevelStreamingObject. The class with this function (LevelStreaming.h) is not declared with ENGINE_API. Was there any engine code that was modified to use the LevelStreaming.h file in your project?

Hey robbiecooper-

I’m not sure what behavior I’m supposed to be seeing. When I approach the trashcan and look at it I see the Start/Finish Narrator focus prompt. If I add a new instance of the trashcan into the level I see the same thing as well as an On Begin Overlap prompt. Both of these cases are the same if I open the mano_narrative_one level and play. I assume that you are referring to the first trashcan not printing the On Begin Overlap message? However this appears to be the case only with the original trashcan, any others placed in either level will print the message as you get close. Let me know exactly what it is that you’re seeing and what you’re expecting to happen.


Doug Wilson

Hi Doug, thanks for looking at it. The debug lines in the narrator class are being triggered, but not in the interactor class (the trash can). If you look at the interactor code, you’ll see it has different debug messages. However, if you create overlap and on hit events for the trashcan in its bp, I’m pretty sure they’ll fire. But I need the C++ delegates and overlap events to fire in the interactor class.

In the Interactor.cpp I see the debug message for “On Begin Overlap Called” “Start Interactor Look Called” and "Checklook Called. Again, while these messages don’t appear for the default trashcan they do appear for any other trashcan blueprint or instance of the interactor class I add to the level. Are these the debug messages you’re referring to?

Ok. Well that sounds good! I’m not in the office but will try that first thing in the morning! I did delete it a couple of times and place new instances. Also tried deleting the bp and creating a new version of it. Anyway, thanks!

Hey Doug. If I add a new instance of the interactor class to the persistent level, it behaves as it should. However, that means that it is also present in river_boat_scene_one. If I add new instances of it and move it to mano_narrative_one, then I’m getting the same behavior that I was before. The problem therefore seems to be something to do with level streaming, perhaps? I sent you a link to a video I did on the forum, showing how to get to mano_narrative_one as a player would.