Hi everyone!
Never posted here before so here goes. I’m using Blueprints and not C++. Just a hypothetical question because I haven’t tried level streaming yet, but it seems to be the solution to my current problem.
I essentially need two “environments” to affect each other. Currently, I’ve been building two separate environments in one map, and possessing the pawn in the other so I can simultaneously make things happen in each after performing an action in one of them. They need to be separate environments (I think, at least) because they both need to function differently.
*My question is, is this possible with level streaming? Theoretically, can an event in Level 1 affect something in Level 2 while using level streaming, and can this be done with Blueprints?
*
Sorry if this is a stupid question, I’m still a little new to developing!
Thanks, though!!
Well with out getting into the nuts and bolts level streaming can be either always loaded or streaming by blue print and each level can support a level blueprint so in say level a you have a BP set up a door in Level B cast for the current state of the switch in level A. The search would be something like “persistent global variables”. Have not done it myself but read that it is possible to pass between maps. Try asking in the blueprint section as to how to pass global vars.
In Unreal Engine, level streaming means ‘expanding’ current Persistent Level.
So, if you are playing inside Level A and stream Level B, C, D, it would become something like:
Persistent Level A
Level B
Level C
Level D
So Level A’s variables are global and could be accessed by sub-levels, or you could store the variables in Game Instance object.
But if you try to access stuff from Level B within Level C or D then you start to have issues because they don’t know about each other.
So using your example. the Persistent Level (A) is like the container and the Levels (B, C, D) are sub-levels, but the sub-levels (B, C, D) are only linked to the Persistent Level (A) and not each other. To get them to communicate, I’d need to use a Game Instance, right?
Either way, I’d never heard of Game Instances before so it’s actually just answered a lot of other questions I had. Going through some tutorials now on how they can be used, thanks guys!