Hi, I have several blueprints called BP_Room01, BP_Room02 etc. that are all in a folder called Rooms and that are all child of the Parent Class BP_SpawnableRoom. I woul like to get all these BP_RoomXX, put them in an array and spawn a random room. I have tried using Get Asset Registry which was able to get all the BP_RoomXX, but I cannot spawn an element from that array using SpawnActorFromClass because the class returned by the array element is Blueprint. If anyone knows how i could get the actual class (instead of Blueprint) from the array element, or how I could get all child actors from the parent class BP_SpawnableRoom into an array, please let me know!
I’ve just been working with spawnable rooms too. I ended up making a master BP in the scene and made everything child components under various categories in that.
Interesting idea, I will keep that in mind, thank you!
Hi, one question, is there a reason why you would spawn the rooms as actors and not as levels? It seems like a rather unusual approach, I might be missing something .
If you have a reference to a UBlueprint object, what I think you can do is just call the UBlueprint::GetBlueprintClass which returns a UClass pointer that you can then use to spawn an actor, assuming that the class your blueprint derives is an Actor class.
It is my first time trying to generate a map while playing, so I just tried to use what already knew to achieve my goal , What would be the advantages of using levels instead of actors?