G’day chaps!
So, I’ve traced my spawn logic’s CPU choke to this set of lines here. And when it finishes the spawning process (even with my rather lightweight begin play functionality tied to the buildable actor disabled), my CPU tanks the frame at a whopping 300ms. Not sure if there’s a way to async this better or have it run the spawn logic with soft refs or something, but I’ve found this very odd as my non-deferred SpawnActor() calls have seemed to be a lot cheaper (e.g. spawning an ai, which seems like it would be more expensive all things considered).
ABuildableActor* NewActor = GetWorld()->SpawnActorDeferred(ActorClass, SpawnTransform);
NewActor->OccupiedTiles = Tiles;
NewActor->MarginTiles = MarginTiles;
NewActor->PlacementOrigin = Origin;NewActor->PlacementRotation = Rotation;
NewActor->FinishSpawning(SpawnTransform);
Thoughts or answers on this are much appreciated! Thank you!