Download

Is Level streaming the right way to do loading screen ?

It’s been several times that I encounter problems regarding the level streaming in my project

I’m using level streaming because I wanted to have dynamic & professionnal looking loading screens between my levels. And the problem I’m facing right now is that when I spawn something in a level, and then change level, the thing the was spawned stay in between levels. This makes sense connsidering it was spawned on the persistent level, and I guess I need to keep track of everything that I spawn to then later kill them on the level change.

But this problem (and the others problems that I encountered before) add to the feeling that I’m not doing things how they are supposed to be. Sure, I can keep track of all that I spawn to delete them later, but that doesn’t sound right, all the “true” videogames out there are not manually deleting everything at every level change, there HAS TO be a cleaner way to do it.

Plus level streaming was intended (if Im not mistaken) to load differents parts of a same level depending on where the player is (kind of like a super occlusion culling), not for level travel.

But everywhere I look, everyone seems to be using level streaming as the go-to option for loading screens so I donn’t know.

My question here is not regarding my specific problem of objects that persits between levels, but a more general question:

Is level streaming really the “good” way to do loading screens ? And if not, what is ?

Streaming is a fine way to do levels and menus / loading screens.

Your problem with assets hanging around is correct. They are spawned into the persistent.

Basically you have to make sure that anything you spawn is owned or connected to something the belongs in the level. That way, when you unload the level, all the spawned stuff will get destroyed too.

Screenshot_1.jpg](filedata/fetch?id=1821114&d=1602446426)

Same with sounds. Use SpawnSoundAttached.

Okay thank you for your help.

I noticed the “owner” pin but I didn’t understood what it’s use was.

Do you know if you can do the same thing with the “outer” pin of the “construct from class” node ?