I am using UE4.27.2. Levels are strreamed in using world composition depending on the player position. This process is handled by the engine.
In the above picture, you can see that my player is at the border between sublevel 00 and sublevel 01 after moving. When he starts off from the start position, only the sublevel 00 is loaded, so all interactions are only with the actors in sublevel 00, which are saved to the save game corresponding to sublevel 00. But at the last position, the sublevel 01 too has loaded. My question is, how do I switch from the data container of sublevel 00 to sublevel 01? Is there a way to know the player crossing the border? As the level data for each sublevel is loaded to memory as the level is spawned in begin play, and in a situation like this, the second level is loaded even before the player is actually on it.
One way would be to place a collider around each sublevel and detect going in and out of the collider.
Another would be to get the positions of the level, each level size, and player position and calculate the player position relative to each level and then decide.
I can also tag each sublevel, but how can I access it from the player? I am at a crossroads trying to figure out how to do this. Any help would be welcome.