Ignisor
(Ignisor)
1
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?
Ignisor
(Ignisor)
3
I spawn room BP derived from class ARoom using TSubclassOf
Ignisor
(Ignisor)
4
Also to spawn room BP i using BeginDeferredActorSpawnFromClass, but i tried to change it on SpawnActor and nothing changed.
Ignisor
(Ignisor)
5
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!