Advice on using multiple blueprints in one asset

I’m currently working on a system for item containers. Trying to make things as reusable as possible. In this instance, I have a desk (interchangeable with cabinets, dressers, etc) which is placed in the level as a blueprint. In the construction script we add two child actors, which are for the drawers or cabinet doors. For those I am using an extension of my door blueprint because it has the same basic functionality and uses locks and keys and my usable item interface. Each of these drawers then adds child actors for the items they will contain (physical objects like a bottle of water). It looks great because the items roll around when the drawer is open like they would in real life.

The problem lies with the child actors. In the current engine version, you can’t access the variables of child actor from a blueprint placed in the level, so I can’t choose the settings for which items to spawn or whether a certain drawer should be locked.

So I’m manually putting them together in the level and using grouping. Not my ideal solution. I tried making it all a single blueprint, but thought this setup would play nicer as far as determining which drawer the player was interacting with and give me an easy way to have varying numbers of drawers with one blueprint.

Any ideas how i could make this work? Are you doing something similar? What was your approach? Thanks :slight_smile:

You could give your parent blueprint a function that adds an object to an array. In your child classes, when they beginplay, they could get their parent, cast it to your type that has the function, and then add themselves to it’s list. Your parent blueprint now has an array filled with all the children that you cared about.

Also, Test your game out early standalone to make sure you aren’t using Editor only features, so it’s what you expect. You don’t want to go along playing in Editor thinking everything is good, then find it doesn’t standalone.

Ok, I get what you mean. If I can reference the children in the array I can cast to them and adjust those variables at runtime. Perfect.

And yeah, I’ve learned the hard way about testing in standalone lol. I had a really weird gbuffer issue that ended up being only in the editor.

Thanks a bunch!! :slight_smile: