Download

SpawnActor on Android problem

well, the situation:
I’m spawning actors dynamically on the game thread


p_name.AppendInt(instance_counter++);

actor_params.Name = *p_name;
actor_params.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;
actor_params.ObjectFlags = EObjectFlags::RF_Standalone;

world_ptr->SpawnActor<MegaActorClass>(ma_blueprint_class, spawn_position, spawn_rotation, actor_params);

it works just fine in the editor. but when I’m trying to run it on Android device, it just crashes the app.
logcat trace shows something like that
Assertion failed: IsValidIndex(Index) && ChunkIndex < NumChunks && Index < MaxTotalElements [File:C:\GitHub\UE4.11\Engine\Source\Runtime\Core\Public\UObject\NameTypes.h]
GetDisplayNameEntry

SpawnActor

and right now I have no idea how to fix this.
will appreciate any help here

Maybe try: auto Spawned = GetWorld()->SpawnActor<MegaActorClass>(ma_blueprint_class)
then set the spawn position and rotation after like:

Spawned->SetActorRelativeLocation(spawn_position);
Spawned->SetActorRelativeRotatation(spawn_rotation);
Spawned->AttachToActor(this, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false));
Spawned->SpawnDefaultController();

or whatever other flags you need, works for me on procedural generation on Android

thanks.
but I found that problem was causing ma_blueprint_class, because it was not loaded on the game thread