Can I Access Actors inside a Level Instance from "outside" of it in BP?

Hi there! Quite new to Unreal here so maybe I’m approaching my situation all wrong so first here’s what I’m trying to accomplish.

I want to create “complex” setups made up of multiple objets (SM, BPs, TriggerVolumes, etc.) that are easy to instantiate for our Level Designers. These setups are self sufficient and contain everything they require to function including a Blueprint object that holds some scripted logic. While these contain all they need to work, an external manager controls which should be active at any given time.

My issue is I can’t seem to find a way to directly target something that is inside of a LevelInstance from a Blueprint that is outside of it. Is what I’m attempting possible with Level instances? Is that even the right tool for what I’m trying to achieve?

(attaching the world’s worst paint diagram hoping it helps understand what I’m trying to do)

[Attachment Removed]

Steps to Reproduce

  • Create a new Actor BP asset (BP_A)
  • Instantiate that new BP inside a level, select it, create a level instance out of it
  • Create a new Actor BP asset (BP_B)
  • In that BP, add a variable(MyTarget) of type BP_A Object Ref, expose it on spawn
  • Instantiate BP_B in the same level
  • In your instance you should have MyTarget visible in the Default category in the Details window
  • Try to use the picker to target your instance of BP_A in your level. It will not allow you
    [Attachment Removed]

Just learned about child actors inside blueprints, this may very well be my salvation

[Attachment Removed]

Hey there! I think we might have touched on this last week, but I didn’t get much of a chance to dig into it. Personally, I try to avoid Child Actor Components as much as humanly possible. Any amount of depth of Child Actor Components is to be avoided at all costs.

You’re right that referencing something inside a Level Instance from outside of it at edit time isn’t supported. The Level Instance itself is the object in the editor. However for runtime, all the actors in all LIs are stamped down into the persistent level. Finding ways to get all those things to communicate with each other without directly referencing each other is key. So in your setup, you’re right that you’d want to have a global race manager.

What I might do here is make sure that the global race manager is a subsystem (which are sort of a singleton), and each of my BP_RaceLogics would register themselves with that global subsystem. When the RaceLogic registers itself with the subsystem, then maybe the subsystem binds to OnComponentOverlapped event of the trigger volume. I’d also probably make the trigger volume part of the BP_RaceLogic itself so I can avoid having to directly reference another actor in the level. Then when the race starts, the race logic will enable a Data Layer that holds all of the checkpoints for that race and those register themselves with the global race manager.

In other cases, I might use something like Gameplay Tags to communicate across things that aren’t spatially loaded. For example, if Switch A opens Door A on the opposite side of the map, I’d set up a gameplay tag like “Switches.DoorA.Enabled” and when I activate Switch A, I set the gameplay tag in a container on some persistent actor (like the player controller, game mode, or game instance. Something that I know is going to get saved as part of the savegame). When DoorA streams in, it checks for its tag in the persistent container, and sets itself up accordingly.

The general advice I have is to make sure you’re structuring your elements in such a way that they can operate if they’re spatially-loaded. If we’re nowhere near Race_003, none of its elements should be active on the game thread. I think Joe Wintergreen just published a really great article about level scripting concepts in Unreal Engine on his blog that’s worth checking out!

[Attachment Removed]