Suggestion: Spawn with Reference, as Instance.
Spawn is very close to a factory feature.
It's reasonably performant, too. Well done.
All that's missing to have the power of OOP/ECS object/entity conceptualisation capabilities in design/architecture considerations: referencing and instancing.
If Reference is turned on, a naming slot becomes active, wherein a name can be manually entered (that'll be incremented for subsequent copies) or box container or anything else that could contain a name can be dropped into it.
If Instance is turned on, the object is an "instance" of its originator, meaning any subsequent changes to the original object occur in the instances.
Better than prefabs because everything in the scene can be better than a prefab, instantly, just by spawning.
Doing this through spawning creates added flexibility and simplicity of comprehension, articulation, education and operation.
And super low cognitive requirements because spawning is a better process and word than instantiation, too. Plus, it's how you do things already.
Then call it day. Head out for lunch...
...right after you fix Sprite Sequence importing.
Kamdroid last edited by
@Deeeds I agree, this feature is needed. However, I don't think spawning can replace prefabs. Prefabs can be created directly in the designer, and used in every scene. I would hate to figure out the needed coordinates for my obsticals and then creating a bunch of spawn behaviours with those coordinates.
@Kamdroid This is an easy problem to solve in the Scene Editor. It's just the manual instancing/referencing of any given object. Exactly like how copy and paste then position works, but instead it's instancing and referencing in the Scene editor.
I've partially solved this problem in the current hyperPad world:
I have dummy objects in my scene, where I want my spawns to go. When the scene starts, a factory gets the position of all the dummy objects, and puts them in an array, then spawns my desired objects at those locations, along with an ID for each, so I can contact them and receive messages from them that I can identify as having come from them.
When I've got the scoring working (this has been a wasted couple of weeks) I'll put up a demo of how to make a factory like this.
Kamdroid last edited by
@Deeeds I've also used dummy objects for spawning in the actual objects, but it's not good enough because I need the object accessible in all scenes.
@Kamdroid It's not an ideal solution, and doesn't come near to solving all the questions asked of references and instances, but you can use the Global UI layer to hide your permanent versions of things, offscreen, so you can persist them through Scenes.