This is something that’s been done thousand times, for sure.
Your game is spawning many BP actors, and you need they pop up in the level with a very precise transform that you can not calculate. You need to manually adjust each to the scene geometry.
I have a copuple of methods in mind. The decission I take now I’m writing the core will define the workflow for weeks, maybe months of work, so I need to really find the best one.
This is what I have in mind:
At game setup the BP_Spawner reads a DataTable where I’ve set an ordered list of BPs to Spawn. Each row of the DataTable (and the subsequent runtime array) is a Struct with a BP Class reference variable and a Transform variable.
Runtime, the Spawner (instigator) will go down that list. “*next spawn is one of these BPs, at with this transform”
That’s the simplest way I’ve figured out to spawn actors with manually set transforms for each. If there’s a easiest way to do this, it’s the right moment to know about it. Any suggestion is welcome.
This solution is simple, but derives in a tedious workflow to set everything up. I have to manually drop an instance actor on the level, carefully place it where I want it to pop up runtime and then, one by one, copypaste Pos/Rot/Scale values from the actor’s transform to the DataTable.
This can be surely semi-automated with an Editor Script that updates the DataTable with a click. (read the datatable to an array → change the desired transform value → generate a csv with new values, reimport datatable)
You could also put the classes and transforms into a save game. A save game can be written to from editor.
You could use a central BP actor that runs through all the BPs in the level and records their transforms in one go. Or you could make it part of the core functionality of the BPs that you’re placing. Place it, then press a button, place the next etc.
The app will be pixelstreamed, volatile, and it’s content editable without re-compiling. So I’m using external storage for content images, texts and videos, and a lot of csv going up and down ( : One more array to load in game setup is not a problem. I’ve a nice optimized workflow for that. Actually, I prefer to store this and the configuration with the same method I’m using for the content, for overall consistency and clarity.
“You could use a central BP actor that runs through all the BPs in the level and records their transforms in one go. Or you could make it part of the core functionality of the BPs that you’re placing. Place it, then press a button, place the next etc”
Yeah, those are exactly the two methods I’m testing today. I’m probably implementing both (basically the same code) and use one or the other depending on the situation.
I’m happy to know my approach makes sense and I’m not missing an easier and more efficient common practice.