TSubclassOf becomes Null when BP spawned

Hi.

I have room BP. Inside this BP i have custom component. In that component i have TSubclassOf variable, set with another trap BP that i need to spawn.

So when i spawn room BP from my code, this variable TSubclassOf becomes Null.

But! When i simply move room BP to the world, everything okay, and variable not Null, and trap BP is spawning.

How can i fix it?

P.s. Sorry for my english.

Are you spawning the room BP or its c++ class?

I spawn room BP derived from class ARoom using TSubclassOf

Also to spawn room BP i using BeginDeferredActorSpawnFromClass, but i tried to change it on SpawnActor and nothing changed.

This is how i fixed it:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Trap) TSubclassOf<class ATrap> Trap;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Trap) TSubclassOf<class ATrap> NewTrap;

Simply duplicated variable!