SpawnActor of blueprint inherited class loses property information

I wanted to spawn an actor that had properties saved in the blueprint editor. The blueprint inherits a c++ class with properties that expose them to the editor. Did I do something wrong?

Screenshot 2022-07-16 110630

Screenshot 2022-07-16 113110

Try TSubclassOf<ACubeActor> instead.
I guess TSubclassOf<AActor> treats the set value as the actor and ignores custom variables declared in ACubeActor BP, so they are defaulted.

1 Like

Use this to specify your class. The class parameter will be TestActor in your case. That way it will spawn an actor of the selected subclass, which I’m guessing is a BP class. If you don’t specify the sub class then yeah like Tuerer said I think it will default the values.

T* SpawnActor(UClass* Class, FTransform const& Transform,const FActorSpawnParameters& SpawnParameters = FActorSpawnParameters())

1 Like