What is the proper way to abstract groups of actors?

After researching everything regarding actors and components, I’m not sure how to approach this problem.

I have a project where I frequently have groups of actors that collectively make up an entity, and in noob terms, I’d like to be able to call methods on such entities and duplicate them to my heart’s desire.

For example, I have a square room entity with four doors on each of the four sides, colored lights above each door, and more. I’d like to make many copies of this square room, and on each room, I’d like to be able to perform actions like OpenNorthDoor() or SetWestLightColor().

What is the proper way to achieve this abstraction?

My only two ideas are:

  • Use folders or actor groups to group actors together in the outliner, and cram all logic into the level script actor. This sounds like it would be a nightmare.
  • Use folders or actor groups to group actors together in the outliner, and for each group, add a dummy actor that references the other actors in the group e.g. the doors and exposes the desired functions e.g OpenNorthDoor()—basically a mini level script actor that’s instanced to a folder of the actors it’s in charge of. This would make sense, but actors have locations and are spawnable, which makes me think this would be a hack.

Blueprint :slight_smile:

How many actors are we talking about?

Maybe up to 20 depending on the complexity? The ability to nest these would alleviate that though. How would a blueprint solve this?

Thank you for your time by the way :slightly_smiling_face:

Yup, so blueprint would be fine.

Even if you don’t add functionality, a blueprint can be used to group meshes:

Indiviual meshes

Blueprint

BP

You can also add functionality inside the BP code:

Be careful with nesting, as that would require child actor blueprints, which are fine, but if you need to ‘talk’ to them, very messy.

Ah, child actor components are the way to have layers of encapsulated instances and related logic. I guess I’ll have to see if the tradeoffs are worth it as I hear they can be janky to use. Thank you!

Blueprints, deffo. Child actor components, don’t ( would be my advice ).