How to scale an actor pre or post spawn

I want to spawn an actor to match the sizes specified. I can get the size of the mesh by using the void GetActorBounds(bool bOnlyCollidingComponents, FVector& Origin, FVector& BoxExtent) const; function I think, so finding the scaling multiplier is easy enough.

However, i have no idea how to spawn a scaled version from C++. I know I can do so in the editor, but the scaling must be dynamic so I must do it via C++. I have a spawn volume that handles spawning and will select the correct blueprint to spawn, but I only know how to spawn a 1x version of the BP. Can I simply set a variable to something, e.g. 9.0f, to get a 9x scaled model?

If I can, how is it done, if I can not, can I do it post spawn?

Thank you for your help.

Hi ,

Try to use this

FTransform SpawnTM(Rotation, Location, Scale3D);
MyActor* pActor = Cast<MyActor>(UGameplayStatics::BeginSpawningActorFromClass(this, MyActorClass, SpawnTM));
if (pActor)
{
	UGameplayStatics::FinishSpawningActor(pActor, SpawnTM);
}

In addition, you can always change scale after spawning.

SetActorScale3D();

Hope it helps!