I want to use a custom level streaming class, as I have a few extra things I want to do on top of LevelStreamingDynamic. I created a simple derived class like the following:
UCLASS(BlueprintType)
class MONSTERMOBILE_API UMMLevelStreamingDynamic : public ULevelStreamingDynamic
{
GENERATED_UCLASS_BODY()
}
Editor Preferences has a setting under LevelEditorMiscSettings for DefaultLevelStreamingClass
. Now my issue is that once I set my new derived class UMMLevelStreamingDynamic
as the desired class, the setting gets cleared on relaunch of the editor, and this setting class appears as None
. This setting is only used when the FStreamingLevelCollectionModel
is constructed, thus changing the setting once the editor has loaded has no impact! Thus, I have to set it, relaunch the editor, and see it loads in blank each time. I am not sure why this keeps failing.
My DefaultEditorPerProjectUserSettings.ini has the following:
[/Script/UnrealEd.LevelEditorMiscSettings]
DefaultLevelStreamingClass=/Script/CoreUObject.Class’/Script/MonsterMobile.MMLevelStreamingDynamic’
I am really baffled why this is happening. It’s obvious the editor recognizes my class, as its a selectable value in the dropdown, but it fails to load on launch in the settings. My end goal is to setup a persistent level with all of my custom streaming levels, so if there is a better way to do this, please let me know.
Edit:
Doing a bit of digging, and found that the CDO loads a nullptr for the the settings during editor load. All of the other engine streaming level classes work fine, but my specific class doesn’t. I wonder if there’s some issue where the class is not yet loaded/known by the editor, and thus it fails to find the reference. If so, is there some way to ensure my class is loaded and available beforehand?