The main level is controlling all the OSC stuff.
I just need to find an alternative to “how to reach all the actors/variables” within the sub-level, from the main level.
Your idea of Get All Actors can work, so creating the arrays from the main level after the sublevel is streamed, vs. doing the arrays within the sublevel.
I don’t really know how your OSC stuff works, but I think you’ll find it’s MUCH easier to put it in an actor in the persistent level ( rather than the level BP ), and then all the actors in streamed levels can just bind to event dispatchers in the OSC actor on begin play.
Then you don’t have to do anything!
If you HAVE to do it with loops from a central point, then go for the ‘register with game instance’ concept. It’s still a lot easier. On begin play, the screens look for the ‘rock screen’ array in the GI and insert themselves in there. Then call an event in the GI to manage themselves. Again, less for you to do.
If you work with the level BP, you’ll always end up with a ‘procedural’ solution. Like programming from the 70s. Do this, then do that, loop, do this etc.
But you can make all the assets understand how to manage themselves, and then you don’t have to do it. You can put the code in the assets, and then just call various dispatchers from a central point, if need be.
My method for creating an endless Camera drive, is to have 2 blocks of this jungle,
so in this method it would mean 2 instances of the level.
Then, with a box collision, when the camera (which has a collider as well) overlaps, I teleport the position forward so the whole block moves.
I don’t see an option though to move the whole level as a whole, similar to moving a blueprint where all the meshes/lights/etc in side move as well.
Is that possible?
So I basically need to
1- have a box collision within the sub-level recognize the the camera (from the main level) has collided.
2- teleport only the relevant sublevel-instance with all its content
Yes exacty how you described it.
I have a blueprint with a collider that moves with the camera,
then when the jungle-blueprint collides with it, it pushes it forward.
I need the sublevel to call the event on the mainlevel, that will push the whole level forward.
Can I reference an outside collider from the sublevel?
So when the camera overlaps, you cast to see what sort of actor you hit. If it’s the first collider in the sub level, then move the previous sub level to it’s new location.
So let’s say I have a collider in the sublevel,
When it overlaps, I check if it hit the right object, then,
how do I tell the main level, that something happened? so only the relevant sublevel moves?
You will know it’s a level end collider. But you will need to do something like tagging them with the level name etc so you can tell them apart. Then you can move the previous level across.
My camera is sort of independent, meaning the user can move it manually as well, without triggering the “teleport” function so to speak,
so imagine the user moves and hits the trigger with the camera, but the camera is just moving back and forth (and not in need to teleport the sublevel forward)
That’s why I have a separated trigger in the main level, which only moves forward if the user activates the “drive” function.
I think I get it though,
I have to set an event for the trigger in the main level,
to check if it collides with “actor has tag ‘sublevel’”
then I have to identify which sublevel it is, then move it