# OnActorPreSpawnInitialization delegate broadcast is completely ignored after deployment on Android

**URL:** <https://forums.unrealengine.com/t/onactorprespawninitialization-delegate-broadcast-is-completely-ignored-after-deployment-on-android/1952216>\
**Category:** Mobile\
**Tags:** unreal-engine\
**Created:** [July 27, 2024, 11:56am UTC](https://forums.unrealengine.com/t/onactorprespawninitialization-delegate-broadcast-is-completely-ignored-after-deployment-on-android/1952216 "2024-07-27T11:56:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeryKnop](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TeryKnop](https://forums.unrealengine.com/u/TeryKnop)\
**Post date:** [July 27, 2024, 11:56am UTC](https://forums.unrealengine.com/t/onactorprespawninitialization-delegate-broadcast-is-completely-ignored-after-deployment-on-android/1952216/1 "2024-07-27T11:56:37Z")

</div>

I’ve created game instance subsystem C++ class which adds specific logic to be run before every spawned actor is initialized. Please see piece of code below. It works good when I run my game in PIE mode in Unreal Engine on PC. But when I deploy it on my Android, game never goes inside of Lambda which I added to OnActorPreSpawnInitialization. Did somebody face similar issue?

```auto
void UMyGameInstanceSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
	auto ActorSpawnLambda = FOnActorSpawned::FDelegate::CreateLambda([this](AActor* InActor)
		{
			UE_LOG(LogTemplateCBGameInstanceSubsystem, Warning, TEXT("Run lambda Starting point"));
			if (AChaosCachePlayer* CCP = Cast<AChaosCachePlayer>(InActor))
			{
				if (ChaosCacheCollection_Temp)
				{
					UE_LOG(LogTemplateCBGameInstanceSubsystem, Warning, TEXT("Run lambda from class UMyGameInstanceSubsystem "));
					PostSpawnChaosCachePlayer(CCP, ChaosCacheCollection_Temp);
					ChaosCacheCollection_Temp = NULL;
				}
			}
		});
	UE_LOG(LogTemplateCBGameInstanceSubsystem, Warning, TEXT("GameInstance subsystem is Initialized"));
	GetWorld()->AddOnActorPreSpawnInitialization(ActorSpawnLambda);
}

```

---

<div class="post-metadata">

**Author:** ![TeryKnop](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TeryKnop](https://forums.unrealengine.com/u/TeryKnop)\
**Post date:** [July 27, 2024, 3:00pm UTC](https://forums.unrealengine.com/t/onactorprespawninitialization-delegate-broadcast-is-completely-ignored-after-deployment-on-android/1952216/2 "2024-07-27T15:00:25Z")

</div>

Upd  
GameInstanse subsystem is loading earlier than GameMode for Android. Delegate can be added in e.g. GameMode constructor to overcome this issue.
