Animating sub-levels

I am trying to create a visualisation of a location over multiple time periods.
When the player travels to a new time period the elements that are not present should sink into the floor and the new elements should rise out of the floor.

I have solved most of the problems but I have hit some issues.

Each separate element has its own level and a level sequence to animate the level. The level sequence sets the level visibility and moves the element out of the ground. The animation is then played in reverse to despawn the element.

This works but from what I understand all the levels will always be loaded into memory which isn’t scalable. I would like to unload the levels when they are no longer needed. This is the major issue I have been hitting.

I can call the load and unload streaming level nodes which does work however once the level is unloaded and loaded again the animation seems to break. The sequence can set the visibility of the level but the movement never works again.

Hopefully there is something simple I am missing.

Now for some more details

Here is an example of the sequence.
The visibility of the level is set to visible for the whole sequence and the z location is animated. I am animating the location of a cube and have all the static meshes for the element as children of that cube.

The animation object is in the main level so that it is always loaded and the main level blueprint loads and unloads the levels and plays the animations. Here is that blueprint. It is a recursive function because the load and unload stream level nodes cannot be called before the previous call has finished.

I would put the sequence in the sub-level with the static meshes but the sequence needs to be visible to play it and that would mean the meshes get shown.

The only success I had was to have two sub-levels per element. One contains just the sequence and the other the meshes. Somehow unloading the sequence allows it to work but it is a rather janky workaround.

If you have a solution or just know of anyone who has done something like this before please let me know. All my searches pointed me to animation loading screens.

I use streaming a lot, but not the sequencer. I find it very difficult to couple with other objects.

Having said that, a quick look over this, makes me think you’re losing references when a level gets streamed out. So when you stream a level back in, sequence object has a different reference.

I think one avenue to investiage might be to make the levels self contained. So when you load a level, and it plays its own sequence.

You can still orchestrate from the perisistent level, although I think you might have trouble with syncronization, but that can probably be fixed.

I think you are onto something.

The element and the sequence can’t be in one level because hiding the element would also hide the sequence and stop the level blueprint.

From some quick testing this workaround seems to work.
The static meshes are in one level.
The sequence and blueprint to play the sequence are in another level. The sequence controls the mesh level visibility and movement.
The main level loads the static mesh level (blocking) and then loads the sequence level.
When the sequence level is loaded it plays the sequence to the last frame and reverse plays it when an event is triggered. When the sequence finishes it automatically hides the mesh level.
The sequence can be played again because everything is still loaded and the references are still valid.
If the element should no longer be visible and the mesh level is not visible then the sequence level can be unloaded followed by the mesh level.

This is a bit of a janky workaround that requires two levels for each element but I don’t see any other way to do it.

1 Like

Another option, is to have all the sequences loaded in the persistent, and when you load a level, you have the reference, and could pass it to the relevant sequence.

Just another idea :slight_smile: