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. C++ overlap event is called whilst actor is in persistent level but not in streaming levels. I made a blueprint from C++ class and created a debugging string in BP, from an overlap event from same sphere component. That overlap event is called when actor is in streaming level, but not in persistent level.

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

Hi robbiecooper,

Thanks for 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 code you’ve written for overlap event in C++ so we can attempt to reproduce this here.

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

	bNodeIsActive = false;

and;
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)
		{
			LoadNodeMeshData();
			bNodeIsActive = true;
		}
	}
}

However, issue has gone. I was getting issue when I dragged a StaticFigureNode from list of classes to left of screen, and after I made a BP and dragged an instance of it into screen. So I deleted that instance, recompiled code, and dragged a new instance of BP into 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 issue returns please feel free to post a reply and we’ll look into it.

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

I guess that’s a bit confusing- onbeginoverlap fires on character but not actor. Onstarthit is called on character but it’s set to fire a delegate in actor, which is not being triggered. I’ve tried rebuilding BP’s from C++ classes and replacing in 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 project to drop box you can send me a PM on forums with a link to download it. Alternatively, if you could post setup steps I can try to reproduce this on my end.

Cheers

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

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

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

Hey robbiecooper-

I have received project you sent however I’ve not been able to open and test 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 project.

Ok, thanks for update :slight_smile:

Hi , I put a word doc in drop box called "notes for ", 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 error…

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

Hey robbiecooper-

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

Cheers

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

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

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

Hey . If I add a new instance of interactor class to 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 same behavior that I was before. problem therefore seems to be something to do with level streaming, perhaps? I sent you a link to a video I did on forum, showing how to get to mano_narrative_one as a player would.