Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to properly unstream and remove a ULevelStreaming from the world?

For example, once you stream in a level like so :

  ULevelStreamingKismet* StreamingLevel = NewObject<ULevelStreamingKismet>((UObject*)GetTransientPackage(), ULevelStreamingKismet::StaticClass());
 // more stuff 
  StreamingLevel->bShouldBeLoaded = true;
  StreamingLevel->bShouldBeVisible = true;
 // more stuff

And then you decide to unstream it by changing the visible and loaded booleans:

  StreamingLevel->bShouldBeLoaded = false;
  StreamingLevel->bShouldBeVisible = false;

But that doesn't entirely remove it from memory and the world because you still have a pointer to the ULevelStreaming and can reassign those booleans to true and the level will stream back in the world again.

So how would you remove it completely from the world? Do you make sure you delete the only pointer you have as a reference to it after you set those booleans to false? Will that completely remove it from memory?

I ask because I'm going to stream in a lot of levels in and out and I don't want to have levels dangling around that I don't need.

Product Version: UE 4.10
more ▼

asked Jan 08 '16 at 01:16 PM in C++ Programming

avatar image

103 9 9 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

me too ,take care of this !

more ▼

answered May 07 '16 at 03:03 AM

avatar image

1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I have yet to test this but ULevelStreaming::SetIsRequestingUnloadAndRemoval sounds like it would do the job. Currently I'm doing this by getting the loaded level with ULevelStreaming::GetLoadedLevel and then calling UEditorLevelUtils::RemoveLevelFromWorld() but this obviously won't remove unloaded streaming levels. (Which is what ULevelStreaming::SetIsRequestingUnloadAndRemoval hopefully does)

more ▼

answered May 09 '19 at 09:31 AM

avatar image

56 1 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question