How to pass parameters to SpawnActor<T>


I have different constructors on my class, one of which takes a boolean value.
I can’t figure out how to pass it in to the SpawnActor function, as it gives out a wrong arguments error every time I try to do

    bool random = true;

1 Like

use SpawnActorDeferred() instead, then you can modify params before calling FinishSpawn()

1 Like

How exactly do you do that ?
Where do you pass in the parameters between SpawnActorDeferred() and FinishSpawningActor()
I tried calling OnConstruction(), but it didnt work properly.

no need to pass. use NewActor = SpawnActorDeferred() the set params as you would do after spawning, e.g. NewActor->AnyParameter = Value; then FinishSpawningActor()