# UGameEngine::Experimental\_ShouldPreDuplicateMap prevents begin play from running

**URL:** <https://forums.unrealengine.com/t/ugameengine-experimental-shouldpreduplicatemap-prevents-begin-play-from-running/2477002>\
**Category:** C++\
**Tags:** unreal-engine, bug-report, question\
**Created:** [April 26, 2025, 12:56pm UTC](https://forums.unrealengine.com/t/ugameengine-experimental-shouldpreduplicatemap-prevents-begin-play-from-running/2477002 "2025-04-26T12:56:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KMC\_FTW](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KMC\_FTW](https://forums.unrealengine.com/u/KMC_FTW)\
**Post date:** [April 26, 2025, 12:56pm UTC](https://forums.unrealengine.com/t/ugameengine-experimental-shouldpreduplicatemap-prevents-begin-play-from-running/2477002/1 "2025-04-26T12:56:37Z")

</div>

When Experimental\_ShouldPreDuplicateMap is set to true, like this:

```auto
bool UGameEngine::Experimental_ShouldPreDuplicateMap(const FName MapName) const
{
	return true;
}

```

This causes `BeginPlay` to be not be called on any actor, in the DynamicSourceLevel or DynamicDuplicateLevel

I built the engine from source, to try to find the cause, this didn’t happen in 5.3, I only noticed it in 5.5 and 5.6.

I started put break points in

```auto
bool UEngine::LoadMap( FWorldContext& WorldContext, FURL URL, class UPendingNetGame* Pending, FString& Error )

```

And stepped through the engine, which lead me here:

```auto
void AWorldSettings::NotifyBeginPlay()
{
	UWorld* World = GetWorld();
	if (!World->GetBegunPlay())
	{
		World->OnWorldPreBeginPlay.Broadcast();

		for (FActorIterator It(World); It; ++It)
		{
			SCOPE_CYCLE_COUNTER(STAT_ActorBeginPlay);
			const bool bFromLevelLoad = true;
			It->DispatchBeginPlay(bFromLevelLoad);
		}

		World->SetBegunPlay(true);
	}
}

```

For some reason, the ActorIterator for the world seems to be empty, causing no actor to have their `BeginPlay` function called.

Is this an engine bug, or is there something I might be missing?

---

<div class="post-metadata">

**Author:** ![KMC\_FTW](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KMC\_FTW](https://forums.unrealengine.com/u/KMC_FTW)\
**Post date:** [April 26, 2025, 2:52pm UTC](https://forums.unrealengine.com/t/ugameengine-experimental-shouldpreduplicatemap-prevents-begin-play-from-running/2477002/2 "2025-04-26T14:52:20Z")

</div>

Turns out in ue5 5.5 and up

You need to set

```auto
[ConsoleVariables]
s.World.CreateStaticLevelCollection=1

```

in

`DefaultEngine.ini`

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [May 26, 2025, 2:53pm UTC](https://forums.unrealengine.com/t/ugameengine-experimental-shouldpreduplicatemap-prevents-begin-play-from-running/2477002/3 "2025-05-26T14:53:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
